Can i only see xmlHttpRequest errors in firebug in firefox - firefox

In the firebug i can see all xmlHttprequests if i check the it in the console options like this
But my site has many js files like 40 and i have to scroll down to see if i get any ajax error in get in red color.
Is there any way to just get those error only.
I tried javascript errors but dont catch any erorr in GET request

That may not answer exactly to your needs, but here is how I usually proceed.
Use the Net panel, and use the "XHR" filter, and then sort by "status".
Every requests that have a status >= 400 have failed. Also see http://en.wikipedia.org/wiki/List_of_HTTP_status_codes
Thus every XHR errors are gathered at the bottom.
Florent

Related

Prevent browser-sync log data in firebug console

I often use gulp and its plugin browser-sync.
Every time i open firebug console tab, i see its full of logs like :
GET http://localhost:3000/browser-sync/socket.io/?EIO=3&transport=polling&t=1457523519574-0 200 OK ۳ms browser...11.1.js (line 2)
I can use clear button but logs are interminable! they will appear twice.is there any persistent way to ride of these(browser-sync) logs?
Yes, there is. Just uncheck the option Show XMLHttpRequests within the Console panel's options menu.
Though note that this will disable the logging for all XMLHttpRequests, (aka AJAX requests).
There is currently no way to filter out specific logs. There are already two enhancements requests for that: issue 4507 and issue 6835 targetting Firebug 2, but as Firebug 3 will be built upon the DevTools, it is probably wiser to follow the DevTools related requests. The closest one to your issue is bug 905978 to filter out messages for blackboxed sources, but I've also filed bug 1102797 some time ago for allowing to blackbox sources from within the Console panel and bug 1255311 right now for ignoring specific log messages.

AJAX error, Drupal 7

I got an AJAX error while running Drupal 7.
"An AJAX error occured.
HTTP result code: 500
Debugging information follows:
Path: system/AJAX
StatusText: error
Response text:"
There is no response text. I have looked everywhere and tried a couple of things, but nothing works. Anyone have an idea on how to fix it?
Thanks
Check your watchdog table, if nothing there check the php error log.
Also use Firebug's console to check what is returned after the ajax request for any clues.
Can also try disabling third party modules one at a time to find out what is causing the error.

How to debug a failed ajax request in google chrome?

I have a web application that crashes on ajax requests with google chrome (it works with every other web browser it was tested it). After debugging I found that the error is caused by response.responseText being undefined. The xhr object looks like this:
argument: undefined
isAbort: false
isTimeout: undefined
status: 0
statusText: "communication failure"
tId: 3
In debugger in the 'network' tab I get "(failed)", however all the headers are there and I can even copy into clipboard the response body (which is a valid JSON).
My question is - how can I debug this problem? Where to find additional information, what causes this request to fail?
I finally found the solution to my problem : AdBlocks, when it blocks an ajax request, it just says "communication failure".
The first thing I would double-check is that the data coming back from the response is valid JSON. Just pass it through a JSON validator like this online JSONLint: http://jsonlint.com/
I assume that you are using something like jQuery to make your AJAX requests. If so, then make sure that you are using the development version of that library. Now that you are using the development version (uncompressed) of the script, find the particular function that you are using (eg. $.ajax) and then, within the Chrome inspector, insert a breakpoint in the code where the AJAX response is first handled (eg. https://github.com/jquery/jquery/blob/master/src/ajax.js#L579). Then proceed to step through the code, inspecting various return-values to see exactly what is going wrong.
If you are not using something like jQuery to make AJAX calls, then I'd recommend using a framework to avoid possible cross-browser compatibility issues like you might be experiencing right now.

MVC3 Custom Errors and HTTP Status

I'm trying to implement this accepted solution for displaying a custom error message:
https://stackoverflow.com/a/5229581/141172
However, IE9 always displays a generic 500 error message with this solution. Google Chrome displays my custom error message.
Making this change:
Response.StatusCode = 200; // don't return: 500
causes the intended behavior in IE9 and Chrome.
However, it does not seem at all reasonable to change the HTTP status code just to make this work in IE9 (for one, website monitoring solutions would not see the 500 if things fail).
How can I add custom error handling in a manner that will work across all browsers, without changing the HTTP status code?
Apparently, IE will ignore a custom error page if it's smaller than 512 bytes. The workaround is to ensure the page has at least 513bytes of data. Also, if you're using gzip compression, it must be more than 512 bytes AFTER compression.

What other 5xx errors could be occuring and how to I find/track them?

I have a Classic ASP/VBScript site running on IIS 6, and a program called SmarterStats (found via an earlier question) providing various stats and info from the server logs. This is an internal site, and we do use integrated authentication (AUTH_TYPE = Negotiate).
I'm looking at the report on response codes, and it says that in the last 7 days there have been 255 responses with a 5xx error code... naturally not the most useful stat I could get back.
I have a custom error page for 500 and 500.100 errors that logs the specifics for me to follow up on - and that log is virtually empty. I've tested with an intentionally broken page, and a standard user account, and it is working as expected - custom message, log entry made. (and checked with "friendly error messages" on and off - works either way)
The only entry I have in the log is a single entry for an error -2147024843 (authentication related, took too long to get a response), and that's it... what other errors could be happening and how can I find/track them?
Should I route all the different types of 5xx errors through my custom page? Or is there something else I should be doing?
Resolution: I'm going to go with running all 5xx errors through the custom page. For reasons that leave me totally baffled, the errors have stopped... I've not changed anything, no one has changed anything on that server - but the errors have stopped. Go figure.
It seems like logging all 5xx errors via your custom page might be a good idea. Your logging seems to be working, but SmarterStats seems like it might be giving you bogus data?
What version of SmarterStats are you using?
My hosting provider has Version 5.2 and I can see a detailed list of which pages have produced a 5xx error by going to Report Items > Server Responses > 5xx - Server Errors in the navigation tree. The report that gets displayed has a table listing the pages that have produced the error codes so you can then go investigate those pages to see what may be causing the error.
Depending on your site the error might be perfectly normal, for example I have some custom HTTP handlers which implement a standardised HTTP protocol which actually specifies that 5xx errors should be thrown under certain circumstances.
Though this shouldn't apply to an internal only site on public websites it is sometimes the case that badly written crawlers will access your pages in such a way as to produce an error

Resources