From 8a3d7d5671e5caa707179fdfa671ef14db363ef9 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> Date: Mon, 6 Feb 2023 10:50:05 +0000 Subject: [PATCH] Element-R: log outgoing HTTP requests (#3127) otherwise it's rather hard to see them, at least in Firefox. --- src/rust-crypto/OutgoingRequestProcessor.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/rust-crypto/OutgoingRequestProcessor.ts b/src/rust-crypto/OutgoingRequestProcessor.ts index c0163f852..7ac9a2105 100644 --- a/src/rust-crypto/OutgoingRequestProcessor.ts +++ b/src/rust-crypto/OutgoingRequestProcessor.ts @@ -104,6 +104,13 @@ export class OutgoingRequestProcessor { prefix: "", }; - return await this.http.authedRequest(method, path, queryParams, body, opts); + try { + const response = await this.http.authedRequest(method, path, queryParams, body, opts); + logger.info(`rust-crypto: successfully made HTTP request: ${method} ${path}`); + return response; + } catch (e) { + logger.warn(`rust-crypto: error making HTTP request: ${method} ${path}: ${e}`); + throw e; + } } }