Skip to content

Commit

Permalink
fix: added additional logging for debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
marnixdessing committed Oct 13, 2022
1 parent ab008fe commit 9c23330
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/app/code/IrmaApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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;
}
Expand Down

0 comments on commit 9c23330

Please sign in to comment.