开发者

jquery not receiving the throw catch error but receive if enable setting in firebug

开发者 https://www.devze.com 2023-03-18 18:47 出处:网络
I have this code for error error: function(xhr) {alert(xhr.responseText); } Now this is showing NuLL with normal setting

I have this code for error

error: function(xhr) {alert(xhr.responseText); }

Now this is showing NuLL with normal setting

But if tick this setting 'Track throw cath error` then i see the full desciption of error in alert box otherwise it shows NULL

I want to know is there any way to receive those error irrespective of firebug option

jquery not receiving the throw catch error but receive if enable setting in firebug

E开发者_JAVA技巧DIT:

I am using django so i was getting the exception . Error returned a full html page but NOne of alert box shows that unless i use the firebug option

The error is the Multi Object exception in Python djnago So that has less relevance

I am not using any try catch in JS


First, this has nothing to do with jQuery. The "throw/catch" error mechanism is a JavaScript thing. Second, this doesn't even look like it has anything to do with thrown exceptions; it looks like you're specifying an error handler for an XMLHttpRequest operation.

Finally, if there's an XHR error and you see a "null" in an alert, you are catching the exception, or handling the error or whatever. If you weren't you wouldn't see the alert at all. The problem is that you're expecting the "responseText" field of the XHR object to contain some error message apparently, and it doesn't.

You could try looking at "xhr.status" or "xhr.statusText".

0

精彩评论

暂无评论...
验证码 换一张
取 消