mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 04:09:49 +00:00
Move throwHumanError to api.js
It is only used there.
This commit is contained in:
@@ -87,7 +87,15 @@ window.textsecure.api = function () {
|
||||
options.error(null, xhr.status);
|
||||
};
|
||||
xhr.send( options.data || null );
|
||||
};
|
||||
}
|
||||
|
||||
function throwHumanError (error, type, humanError) {
|
||||
var e = new Error(error);
|
||||
if (type !== undefined)
|
||||
e.name = type;
|
||||
e.humanError = humanError;
|
||||
throw e;
|
||||
}
|
||||
|
||||
var doAjax = function (param) {
|
||||
if (param.urlParameters === undefined) {
|
||||
|
||||
Reference in New Issue
Block a user