Skip to content

Commit

Permalink
Better messaging on low-level network errors (#814).
Browse files Browse the repository at this point in the history
  • Loading branch information
ricmoo committed May 3, 2020
1 parent 7b1a7c7 commit 0e3a66c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/web/src.ts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 0e3a66c

Please sign in to comment.