@overturebio-stack/lectern-client
Advanced tools
Comparing version 1.0.0 to 1.1.0
@@ -56,3 +56,3 @@ "use strict"; | ||
L.error(`failed to fetch schema using this url: ${url}`, err); | ||
throw new Error('failed to get the schema'); | ||
throw new Error(err.message); | ||
} | ||
@@ -86,5 +86,6 @@ }), | ||
const doRequest = (url) => __awaiter(void 0, void 0, void 0, function* () { | ||
let response; | ||
try { | ||
const retryAttempt = 1; | ||
const response = yield promise_tools_1.default.retry({ times: 5, interval: 1000 }, () => __awaiter(void 0, void 0, void 0, function* () { | ||
response = yield promise_tools_1.default.retry({ times: 5, interval: 1000 }, () => __awaiter(void 0, void 0, void 0, function* () { | ||
L.debug(`fetching schema attempt #${retryAttempt}`); | ||
@@ -97,3 +98,4 @@ return promise_tools_1.default.timeout(node_fetch_1.default(url), 5000); | ||
L.error(`failed to fetch schema using this url: ${url}`, err); | ||
throw new Error('failed to get the schema'); | ||
const error = response.status == 404 ? new Error('Not Found') : new Error('Request Failed'); | ||
throw error; | ||
} | ||
@@ -100,0 +102,0 @@ }); |
{ | ||
"name": "@overturebio-stack/lectern-client", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"files": [ | ||
@@ -5,0 +5,0 @@ "lib/**/*" |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
138715
1501