aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-util
diff options
context:
space:
mode:
Diffstat (limited to 'packages/taler-util')
-rw-r--r--packages/taler-util/src/http-common.ts18
1 files changed, 10 insertions, 8 deletions
diff --git a/packages/taler-util/src/http-common.ts b/packages/taler-util/src/http-common.ts
index e42892f9d..3f310e2b6 100644
--- a/packages/taler-util/src/http-common.ts
+++ b/packages/taler-util/src/http-common.ts
@@ -333,14 +333,16 @@ export function throwUnexpectedRequestError(
httpResponse: HttpResponse,
talerErrorResponse: TalerErrorResponse,
): never {
+ const errorDetails = {
+ requestUrl: httpResponse.requestUrl,
+ requestMethod: httpResponse.requestMethod,
+ httpStatusCode: httpResponse.status,
+ errorResponse: talerErrorResponse,
+ };
+ logger.trace(`unexpected request error: ${j2s(errorDetails)}`);
throw TalerError.fromDetail(
TalerErrorCode.WALLET_UNEXPECTED_REQUEST_ERROR,
- {
- requestUrl: httpResponse.requestUrl,
- requestMethod: httpResponse.requestMethod,
- httpStatusCode: httpResponse.status,
- errorResponse: talerErrorResponse,
- },
+ errorDetails,
`Unexpected HTTP status ${httpResponse.status} in response`,
);
}
@@ -502,8 +504,8 @@ export function encodeBody(body: unknown): ArrayBuffer {
return body.buffer;
} else if (body instanceof ArrayBuffer) {
return body;
- } else if (body instanceof URLSearchParams) {
- return textEncoder.encode(body.toString()).buffer
+ } else if (body instanceof URLSearchParams) {
+ return textEncoder.encode(body.toString()).buffer;
} else if (typeof body === "object" && body.constructor.name === "FormData") {
return body as ArrayBuffer;
} else if (typeof body === "object") {