Skip to content

Commit

Permalink
logging update
Browse files Browse the repository at this point in the history
  • Loading branch information
mikilukasik committed Oct 4, 2024
1 parent d8651ef commit 38b0fd7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
6 changes: 2 additions & 4 deletions dist/utils/invokeService.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,12 @@ const invokeService = async (service, path, method, data, options) => {
return await rawResponse.json();
}
catch (error) {
throw new Error(`Error while invoking service ${service}: ${error.message} ${JSON.stringify({
throw new Error(`Error while invoking service ${service}: ${error.message} ${error.cause?.code} ${JSON.stringify({
error,
service,
path,
method,
data,
options,
})} `);
}, null, 2)} `);
}
};
exports.invokeService = invokeService;
22 changes: 12 additions & 10 deletions src/utils/invokeService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,16 +108,18 @@ export const invokeService = async (
return await rawResponse.json();
} catch (error: any) {
throw new Error(
`Error while invoking service ${service}: ${
error.message
} ${JSON.stringify({
error,
service,
path,
method,
data,
options,
})} `
`Error while invoking service ${service}: ${error.message} ${
error.cause?.code
} ${JSON.stringify(
{
error,
service,
path,
method,
},
null,
2
)} `
);
}
};

0 comments on commit 38b0fd7

Please sign in to comment.