diff --git a/packages/web/src.ts/index.ts b/packages/web/src.ts/index.ts index 2d7e6dfb00..6508952e58 100644 --- a/packages/web/src.ts/index.ts +++ b/packages/web/src.ts/index.ts @@ -122,7 +122,12 @@ export function fetchJson(connection: string | ConnectionInfo, json?: string, pr if (timer == null) { return; } timer = null; - reject(logger.makeError("timeout", Logger.errors.TIMEOUT, { timeout: timeout })); + reject(logger.makeError("timeout", Logger.errors.TIMEOUT, { + requestBody: (options.body || null), + requestMethod: options.method, + timeout: timeout, + url: url + })); }, timeout); } }); @@ -146,6 +151,8 @@ export function fetchJson(connection: string | ConnectionInfo, json?: string, pr if (response == null) { runningTimeout.cancel(); logger.throwError("missing response", Logger.errors.SERVER_ERROR, { + requestBody: (options.body || null), + requestMethod: options.method, serverError: error, url: url }); @@ -164,6 +171,8 @@ export function fetchJson(connection: string | ConnectionInfo, json?: string, pr status: response.statusCode, headers: response.headers, body: body, + requestBody: (options.body || null), + requestMethod: options.method, url: url }); } @@ -178,6 +187,8 @@ export function fetchJson(connection: string | ConnectionInfo, json?: string, pr logger.throwError("invalid JSON", Logger.errors.SERVER_ERROR, { body: body, error: error, + requestBody: (options.body || null), + requestMethod: options.method, url: url }); } @@ -189,7 +200,10 @@ export function fetchJson(connection: string | ConnectionInfo, json?: string, pr } catch (error) { logger.throwError("processing response error", Logger.errors.SERVER_ERROR, { body: json, - error: error + error: error, + requestBody: (options.body || null), + requestMethod: options.method, + url: url }); } }