1

I'm using Upshotjs and knockout in an MVC4 SPA project to create a simple blog site. I am trying to enable roles based authentication so that only registered users can post a blog.

To do this I have an authorize filter on the DbDataController AddBlog method which passes back a 401 for unathorised users. This works fine and the error callback function in the orginating dataSource.commitChanges call is fired off but how do I get the error details from this function?

I have tried the dataSource.getEntityErrors method but this has nothing in it.

Grateful for any help.

user1389723
  • 713
  • 1
  • 6
  • 9
  • I apologize but I do not fully understand your question or what you are trying to accomplish. A 401 Server Error is just a form of server response. I don't think it literally throws an exception. (I could be wrong.) Are you just wanting to execute some logic on the server if the user is unauthorized, or are you trying to do something else? – Anthony Gatlin May 21 '12 at 04:17
  • Thanks for the response. I think I have fixed it by using the bind method of the remotedatasource and tying that to an errorhandler, but thanks for taking the time to respond. – user1389723 May 23 '12 at 08:35

0 Answers0