mirror of
https://github.com/vladmandic/automatic
synced 2026-09-18 16:54:33 +02:00
wrap all internal api calls with auth check and use token when possible
Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
@@ -54,11 +54,11 @@ const xhrInternal = (xhrObj, data, handler = undefined, errorHandler = undefined
|
||||
try {
|
||||
const json = JSON.parse(xhrObj.responseText);
|
||||
if (handler) handler(json);
|
||||
} catch (e) {
|
||||
error(`xhr.onreadystatechange: ${e}`);
|
||||
} catch {
|
||||
// error(`xhr.onreadystatechange: ${e}`);
|
||||
}
|
||||
} else {
|
||||
err(`xhr.onreadystatechange: state=${xhrObj.readyState} status=${xhrObj.status} response=${xhrObj.responseText}`);
|
||||
// err(`xhr.onreadystatechange: state=${xhrObj.readyState} status=${xhrObj.status} response=${xhrObj.responseText}`);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user