diff options
Diffstat (limited to 'packages/taler-util/src')
-rw-r--r-- | packages/taler-util/src/http-impl.qtart.ts | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/packages/taler-util/src/http-impl.qtart.ts b/packages/taler-util/src/http-impl.qtart.ts index f60c82fc3..6ccd35b83 100644 --- a/packages/taler-util/src/http-impl.qtart.ts +++ b/packages/taler-util/src/http-impl.qtart.ts @@ -102,8 +102,8 @@ export class HttpLibImpl implements HttpRequestLibrary { if (opt?.headers) { Object.entries(opt?.headers).forEach(([key, value]) => { if (value === undefined) return; - requestHeadersMap[key] = value - }) + requestHeadersMap[key] = value; + }); } let headersList: string[] = []; for (let headerName of Object.keys(requestHeadersMap)) { @@ -115,13 +115,12 @@ export class HttpLibImpl implements HttpRequestLibrary { const cancelPromCap = openPromise<QjsHttpResp>(); + logger.trace(`calling qtart fetchHttp`); + // Just like WHATWG fetch(), the qjs http client doesn't // really support cancellation, so cancellation here just // means that the result is ignored! - const { - promise: fetchProm, - cancelFn - } = qjsOs.fetchHttp(url, { + const { promise: fetchProm, cancelFn } = qjsOs.fetchHttp(url, { method, data, headers: headersList, @@ -138,6 +137,7 @@ export class HttpLibImpl implements HttpRequestLibrary { if (opt?.cancellationToken) { cancelCancelledHandler = opt.cancellationToken.onCancelled(() => { + logger.trace(`cancelling quickjs request`); cancelFn(); cancelPromCap.reject(new RequestCancelledError()); }); @@ -147,6 +147,7 @@ export class HttpLibImpl implements HttpRequestLibrary { try { res = await Promise.race([fetchProm, cancelPromCap.promise]); } catch (e) { + logger.trace(`got exception while waiting for qtart http response`); if (e instanceof RequestCancelledError) { throw TalerError.fromDetail( TalerErrorCode.WALLET_UNEXPECTED_REQUEST_ERROR, @@ -172,6 +173,8 @@ export class HttpLibImpl implements HttpRequestLibrary { throw e; } + logger.trace(`got qtart http response, status ${res.status}`); + if (timeoutHandle != null) { clearTimeout(timeoutHandle); } |