Commit 8312305d authored by Diegodlh's avatar Diegodlh
Browse files

Make HttpCache's fetchData reject with HTTPResponseError

parent 5b098c88
......@@ -3,6 +3,7 @@
import fetch from "node-fetch";
import { fetchSimpleCitation, SimpleCitoidCitation } from "../citoid";
import { JSDOM } from "jsdom";
import { HTTPResponseError } from "../errors";
abstract class ResponseCache {
url: string;
......@@ -72,7 +73,7 @@ class HttpCache extends ResponseCache {
resolve(data);
} else {
this._refreshing = false;
reject("response status not ok");
reject(new HTTPResponseError(response));
}
})
.catch((reason) => {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment