Skip to content

Commit

Permalink
Include request body in web errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
ricmoo committed Dec 5, 2018
1 parent f56fc57 commit 4f6748e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src.ts/utils/web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ export function fetchJson(connection: string | ConnectionInfo, json: string, pro
let jsonError: any = new Error('invalid json response');
jsonError.orginialError = error;
jsonError.responseText = request.responseText;
if (json != null) {
jsonError.requestBody = json;
}
jsonError.url = url;
reject(jsonError);
return;
Expand Down Expand Up @@ -163,7 +166,7 @@ export function fetchJson(connection: string | ConnectionInfo, json: string, pro
}

try {
if (json) {
if (json != null) {
request.send(json);
} else {
request.send();
Expand Down

0 comments on commit 4f6748e

Please sign in to comment.