2
0
mirror of synced 2025-02-23 11:38:42 +00:00

Better messaging on low-level network errors (#814).

This commit is contained in:
Richard Moore 2020-05-03 16:24:18 -04:00
parent 7b1a7c7f31
commit 0e3a66c829
No known key found for this signature in database
GPG Key ID: 665176BE8E9DC651

View File

@ -137,10 +137,16 @@ export function fetchJson(connection: string | ConnectionInfo, json?: string, pr
try {
response = await getUrl(url, options);
} catch (error) {
console.log(error);
response = (<any>error).response;
if (response == null) {
logger.throwError("missing response", Logger.errors.SERVER_ERROR, {
serverError: error,
url: url
});
}
}
let body = response.body;
if (allow304 && response.statusCode === 304) {