Synchronize with Etiquette.

This commit is contained in:
voussoir 2020-09-18 16:35:02 -07:00
parent 741cddc2e4
commit 34aafedf46

View file

@ -18,15 +18,23 @@ function _request(method, url, callback)
if (callback == null) if (callback == null)
{return;} {return;}
if (request.status != 0)
{
response.completed = true;
response.data = JSON.parse(request.responseText);
}
response.meta = { response.meta = {
"request_url": url, "request_url": url,
"status": request.status "status": request.status
} }
if (request.status != 0)
{
response.completed = true;
try
{
response.data = JSON.parse(request.responseText);
response.meta.json_ok = true;
}
catch (exc)
{
response.meta.json_ok = false;
}
}
callback(response); callback(response);
}; };
const asynchronous = true; const asynchronous = true;