summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/util/http.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2020-08-06 00:30:36 +0530
committerFlorian Dold <florian.dold@gmail.com>2020-08-06 00:30:36 +0530
commit82a2437c0967871d6b942105c98c3382978cad29 (patch)
treeda803c3d4a58d9c691f5908b379791c8ee55cc37 /packages/taler-wallet-core/src/util/http.ts
parenta8f03d3dd1ad04abf7f569cb44933b6dce6713e7 (diff)
downloadwallet-core-82a2437c0967871d6b942105c98c3382978cad29.tar.gz
wallet-core-82a2437c0967871d6b942105c98c3382978cad29.tar.bz2
wallet-core-82a2437c0967871d6b942105c98c3382978cad29.zip
towards integration tests with fault injection
Diffstat (limited to 'packages/taler-wallet-core/src/util/http.ts')
-rw-r--r--packages/taler-wallet-core/src/util/http.ts7
1 files changed, 7 insertions, 0 deletions
diff --git a/packages/taler-wallet-core/src/util/http.ts b/packages/taler-wallet-core/src/util/http.ts
index ad9f0293c..72de2ed1d 100644
--- a/packages/taler-wallet-core/src/util/http.ts
+++ b/packages/taler-wallet-core/src/util/http.ts
@@ -34,6 +34,7 @@ const logger = new Logger("http.ts");
*/
export interface HttpResponse {
requestUrl: string;
+ requestMethod: string;
status: number;
headers: Headers;
json(): Promise<any>;
@@ -118,6 +119,8 @@ export async function readSuccessResponseJsonOrErrorCode<T>(
"Error response did not contain error code",
{
requestUrl: httpResponse.requestUrl,
+ requestMethod: httpResponse.requestMethod,
+ httpStatusCode: httpResponse.status,
},
),
);
@@ -188,7 +191,9 @@ export async function readSuccessResponseTextOrErrorCode<T>(
TalerErrorCode.WALLET_RECEIVED_MALFORMED_RESPONSE,
"Error response did not contain error code",
{
+ httpStatusCode: httpResponse.status,
requestUrl: httpResponse.requestUrl,
+ requestMethod: httpResponse.requestMethod,
},
),
);
@@ -217,7 +222,9 @@ export async function checkSuccessResponseOrThrow(
TalerErrorCode.WALLET_RECEIVED_MALFORMED_RESPONSE,
"Error response did not contain error code",
{
+ httpStatusCode: httpResponse.status,
requestUrl: httpResponse.requestUrl,
+ requestMethod: httpResponse.requestMethod,
},
),
);