-
Notifications
You must be signed in to change notification settings - Fork 384
fix(calling): fix the ExtendedError usage in logs and UTs #4546
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(calling): fix the ExtendedError usage in logs and UTs #4546
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes LGTM.
Can we have a ss showing some of the updated logs? Just to verify the shape.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quick question, we still have ExtendedError being used by LinError, CallError to crea the call object. Is that code still relevant ? Do we still need it ? Did we only need to remove the typecasting ?
Also can we test basic error cases where we have made change and add that for testing proofs
| const errorStatus = await serviceErrorCodeHandler(errorInfo, loggerContext); | ||
|
|
||
| log.error(errorLog, loggerContext); | ||
| log.error( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't call.test.s file require changes for these ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a private method and not being called anywhere inside this file. We can discuss and remove this method itself if it's not required
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant changes for the error message changing. Do we have error spy for these logs created in test files and being checked. If not we should add
|
68b9b88 to
c8a7837
Compare
736ed86 to
072c1fc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving the PR.
But please add the log spy for log.error and log.log occurrences as it is crucial. One of the point was this in the acceptance criteria of Jira
COMPLETES #< CAI-7234 >
This pull request addresses
We were using the
ExtendedErrorjust for the typecasting to match the param type forlogger.error. The logger.error was also accepting the 2nd param for context (file and method name) and we are passing that info everywhere so using the ExtendedError type was not required. From the first argument oflogger.erroras error object we were simply using theerror.messageto print the log so, now we are simply passing the error message and printing it directly. Keeping it consistent with all other logger methods and reducing the boilerplate.Also stringifying the error object so that we don't get
[object Object]in the logs.by making the following changes
Error logs are cleanly added now.
Change Type
The following scenarios were tested
< ENUMERATE TESTS PERFORMED, WHETHER MANUAL OR AUTOMATED >
The GAI Coding Policy And Copyright Annotation Best Practices
I certified that
Make sure to have followed the contributing guidelines before submitting.