From 9c23330a7ce59deb9af352383ca3bf029f7f31be Mon Sep 17 00:00:00 2001 From: Marnix Dessing Date: Thu, 13 Oct 2022 16:40:31 +0200 Subject: [PATCH] fix: added additional logging for debugging --- src/app/code/IrmaApi.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/app/code/IrmaApi.ts b/src/app/code/IrmaApi.ts index 5006f3d8..7dbc44b9 100644 --- a/src/app/code/IrmaApi.ts +++ b/src/app/code/IrmaApi.ts @@ -87,7 +87,7 @@ export class IrmaApi { async makeSignedRequest(request: axios.AxiosRequestConfig, errorMsg: string) { try { - console.log('Making signed request: ', request); + console.debug('Making signed request: ', request); const interceptor = aws4Interceptor({ region: 'eu-west-1', @@ -96,14 +96,15 @@ export class IrmaApi { axios.default.interceptors.request.use(interceptor); let resp = await axios.default.request(request); + console.debug(resp); if (resp.data) { return resp.data; } else { - throw Error(); + throw Error(errorMsg); } - } catch { + } catch(error: any) { const data = { - error: errorMsg, + error: error.message, }; return data; }