Use UnexpectedStatusException in Zotero.HTTP.loadDocuments()
Follow-up to 76ae5d9f59
, which changed loadDocuments() to pass/throw an
Error on a non-2xx response code
This commit is contained in:
parent
76ae5d9f59
commit
29f48476a9
2 changed files with 24 additions and 3 deletions
|
@ -302,5 +302,17 @@ describe("Zotero.HTTP", function () {
|
|||
});
|
||||
assert.isTrue(called);
|
||||
});
|
||||
|
||||
it("should fail on non-2xx response", async function () {
|
||||
var e = await getPromiseError(new Zotero.Promise((resolve, reject) => {
|
||||
Zotero.HTTP.loadDocuments(
|
||||
baseURL + "nonexistent",
|
||||
() => {},
|
||||
resolve,
|
||||
reject
|
||||
);
|
||||
}));
|
||||
assert.instanceOf(e, Zotero.HTTP.UnexpectedStatusException);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue