I would like to display error details on a page for errors that produce no request.responseText value. Is there some other location this information is stored?
Chrome network tab shows it as following and some other things:
(failed) net::ERR_FAILED
Related
I am using Facebook graph API to create a Facebook ads campaign from Google Apps Script.
I successfully create a Campaign, I get the ID of this new campaign and then I try to create an adset associated with it, but I get the following error:
Exception: Request failed for https://graph.facebook.com returned code 400. Truncated server response: {"error":{"message":"Invalid parameter","type":"OAuthException","code":100,"error_subcode":1815430,"is_transient":false,"error_user_title":"Nessun ... (use muteHttpExceptions option to examine full response)
at createAdsets(Create:309:36)
The facebook Url I encode and then fetch is:
https://graph.facebook.com/v7.0/act_XXX/adsets?name=BlaBla&daily_budget=5000&campaign_id=YYY&bid_strategy=LOWEST_COST_WITHOUT_CAP&billing_event=IMPRESSIONS&optimization_goal=LEAD_GENERATION&targeting={"age_max":65,"age_min":25,"geo_locations":{"countries":["IT"],"location_types":["home","recent"]},"targeting_optimization":"expansion_all","brand_safety_content_filter_levels":["FACEBOOK_STANDARD"]}&status=PAUSED&access_token=ZZZ
Do you see any mistake in this UTL?
If not, can you help me see the full Truncated server response, especially the "error_user_title"?
In order to do that I have already tried:
To pass the muteHttpExceptions: true as options, but I only get the full response without being able to examine the error
To use the stackdriver with console.error method, but the "error" remains truncated.
So, I have a rest api developed in Express. For authentication, I'm using cookies and to fetch user info I just do a get request to an endpoint that return me user info if its logged in or a 401 (Unauthorized) status code if its not. My concern is about, when I get a 401 status code, the chrome developer console print
Failed to load resource: the server responded with a status of 401
(Unauthorized)
It does not cause any bug in the client, just that It bothers me to see it hah.
Create an interceptor in the HTTP requests and upon received response, use the single line code console.clear(); to clear the console output.
In that way, even if you receive 401 or 403 or any response from server and a console error/warning is auto generated, then it will be auto cleared as well!
Browser: Firefox 58.0.2 (64-bit)
I'm trying to write a very simple service worker to cache content for offline mode, following the guidance here and here.
When I load the page the first time, the service worker is installed properly. I can confirm it's running by looking in about:debugging#workers.
However, at this point if I attempt to refresh the page (whether online or offline), or navigate to any other page in the site, I get the following error:
The site at https://[my url] has experienced a network protocol
violation that cannot be repaired.
The page you are trying to view cannot be shown because an error in
the data transmission was detected.
Please contact the website owners to inform them of this problem.
The console shows this error:
Failed to load ‘https://[my url]’. A ServiceWorker passed a redirected Response to FetchEvent.respondWith() while RedirectMode is not ‘follow’.
In Chrome, I get this:
Uncaught (in promise) TypeError: Failed to execute 'fetch' on 'ServiceWorkerGlobalScope': Cannot construct a Request with a Request whose mode is 'navigate' and a non-empty RequestInit.
Per this thread, I added the { redirect: "follow" } parameter to the fetch() function, but to no avail.
(Yes I did manually uninstall the Service Worker from the about:debugging page after making the change.)
From what I understand, however, it's the response, not the fetch, that's causing the problem, right? And this is due to my server issuing a redirect when serving the requested content?
So how do I deal with redirects in the service worker? There are obviously going to be some, and I still want to cache the data.
Partly spun off from https://superuser.com/a/1388762/84988
I sometimes get the problem with Gmail with Waterfox 56.2.6 on FreeBSD-CURRENT. (Waterfox 56 was based on Firefox 56.0.2.) Sometimes when simply reloading the page; sometimes when loading the page in a restored session; and so on.
FetchEvent.respondWith() | MDN begins with an alert:
This is an experimental technology …
At a glance, the two bugs found by https://bugzilla.mozilla.org/buglist.cgi?quicksearch=FetchEvent.respondWith%28%29 are unrelated.
Across the Internet there are numerous reports, from users of Gmail with Firefox, of Corrupted Content Error, network protocol violation etc.. Found:
Mozilla bug 1495275 - Corrupted Content Error for gmail
If you look at the following site http://styles.my/thestar/ , the inspect element using chrome shows a 404 for http://shopping.thestar.com.my/image/.
How can I find or trace back the code that producing this error?
I can see a a 403 error.
Failed to load resource: the server responded with a status of 403 (Forbidden)
Has to be something about permission in the server side. And this is the correct URL for this resource http://styles.my/thestar/image/
Make sure you ask with the correct info :)
I'm writing a script that uses an XMLHttpRequest to search for a file defined by a relative path, by attempting to resolve that relative path against other same domain absolute paths that the script is aware of, then attempting to load the file from that resolved url. If I encounter a 404, I just try to resolve the files relative path against another absolute path, and try again. For this particular script, its perfectly fine to encounter a 404- however, my console is littered with 'Failed to load resource: the server responded with a status of 404 (Not Found) messages, and I want to suppress them.
There is no error to catch as far as I can see- error cases are handled by the xmlHttpRequest.onreadystatechange handler, and there is no window.onerror.
Is there any way to suppress these messages?
Thanks
This feature was introduced last year. You can enable it here: DevTools->Settings->General->Console->Hide network messages.
See also Filtering the Console output and Additional settings in the devtools documentation.
Use console.clear() in the catch block or error handler function.
It will clear those request error on the console immediately after it is logged.
PLEASE NOTE
From MDN
Note that in Google Chrome, console.clear() has no effect if the user has selected "Preserve log upon navigation" in the settings.
Read more about it on MDN
try {
var req = new XMLHttpRequest();
req.open('GET', 'https://invalidurl', false);
req.send();
} catch(e) {
console.clear();
}
Should log this
GET https://invalidurl/ net::ERR_NAME_NOT_RESOLVED
but it will be cleared.
If you use a web worker to perform XMLHttpRequest requests, the errors will be logged into the worker script context so they will not appear on the console unless this context will be specifically chosen for display.