How to retrieve exact information about a network error? Chrome browser prints things like "net::ERR_CONNECTION_TIMED_OUT" or "net::ERR_CERT_INVALID" into console but how can I retrieve them via JS? Is that possible to get them at all? Currently I use fetch API but I can switch to XMLHTTPRequest easily.
I need that to handle such errors to inform a user and let him know what does he need to do.