I have a code like this in one of my controller code:
-----------
    @expose('json')
@require(predicates.has_permission(u'something', msg=u'You do not have permission!'))
    def somejsonhandler(self, **kw):
        somevalue = u'something'
        someint = 123
        return dict(somevalue=somevalue, someint=someint)
----------

This is called by an ajax code from the browser.
I can not catch the error, that code always returns status code 200.

I'm using jquery library for ajax.
The error handler code like this:
function AJAX_error(xhr, textStatus, errorThrown){
alert('Message from Server: ' + xhr.status + '\n:\n' + errorThrown + '\n:\n' + textStatus);
};

this javascript is called and I see that status is 200 and it's actually sending me the login page and it errors because ajax function was waiting for a json response.

can you point me some hints to "how can I get 403 status code or something other than 200 ?"


--
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en.

Reply via email to