Add comment about response catching strictness levels.

This commit is contained in:
voussoir 2021-01-01 19:08:36 -08:00
parent b73fb69612
commit 89195d3449

View file

@ -76,6 +76,12 @@ function _request(method, url, callback)
}
"data": {JSON parsed from server response if json_ok}.
}
So, from most lenient to most strict, error catching might look like:
if response.meta.completed
if response.meta.json_ok
if response.meta.status === 200
if response.meta.status === 200 and response.meta.json_ok
*/
const request = new XMLHttpRequest();
const response = {