Add an ability to throw non-error alerts from connector integration
This commit is contained in:
parent
fedd6f8241
commit
07c8269433
1 changed files with 6 additions and 1 deletions
|
@ -63,7 +63,12 @@ Zotero.Server.Endpoints['/connector/document/respond'].prototype = {
|
|||
if (typeof data.stack != "string") {
|
||||
data.stack = JSON.stringify(data.stack);
|
||||
}
|
||||
Zotero.HTTPIntegrationClient.deferredResponse.reject(data);
|
||||
let error = data;
|
||||
if (data.error == 'Alert') {
|
||||
error = new Zotero.Exception.Alert(data.message);
|
||||
error.stack = data.stack;
|
||||
}
|
||||
Zotero.HTTPIntegrationClient.deferredResponse.reject(error);
|
||||
} else {
|
||||
Zotero.HTTPIntegrationClient.deferredResponse.resolve(data);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue