Skip to content

Conversation

@rarajes2
Copy link
Contributor

@rarajes2 rarajes2 commented Oct 17, 2025

COMPLETES #< CAI-7234 >

This pull request addresses

We were using the ExtendedError just for the typecasting to match the param type for logger.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 of logger.error as error object we were simply using the error.message to 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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Tooling change
  • Internal code refactor

The following scenarios were tested

< ENUMERATE TESTS PERFORMED, WHETHER MANUAL OR AUTOMATED >

The GAI Coding Policy And Copyright Annotation Best Practices

  • GAI was not used (or, no additional notation is required)
  • Code was generated entirely by GAI
  • GAI was used to create a draft that was subsequently customized or modified
  • Coder created a draft manually that was non-substantively modified by GAI (e.g., refactoring was performed by GAI on manually written code)
  • Tool used for AI assistance (GitHub Copilot / Other - specify)
    • Github Copilot
    • Other - Please Specify
  • This PR is related to
    • Feature
    • Defect fix
    • Tech Debt
    • Automation

I certified that

  • I have read and followed contributing guidelines
  • I discussed changes with code owners prior to submitting this pull request
  • I have not skipped any automated checks
  • All existing and new tests passed
  • I have updated the documentation accordingly

Make sure to have followed the contributing guidelines before submitting.

@rarajes2 rarajes2 requested a review from a team as a code owner October 17, 2025 15:39
@rarajes2 rarajes2 added the validated If the pull request is validated for automation. label Oct 17, 2025
Copy link
Contributor

@adhmenon adhmenon left a 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.

Copy link
Contributor

@Kesari3008 Kesari3008 left a 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(
Copy link
Contributor

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 ?

Copy link
Contributor Author

@rarajes2 rarajes2 Oct 23, 2025

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

Copy link
Contributor

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

@rarajes2
Copy link
Contributor Author

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

ExtendedError is used in CallError and LineError and they are being used in the error handling methods. Typecasting was unnecessary

@rarajes2 rarajes2 force-pushed the log-UTs-extended-error-CAI-7234 branch from 68b9b88 to c8a7837 Compare October 23, 2025 03:42
@rarajes2 rarajes2 force-pushed the log-UTs-extended-error-CAI-7234 branch from 736ed86 to 072c1fc Compare October 23, 2025 08:01
Copy link
Contributor

@Kesari3008 Kesari3008 left a 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

@rarajes2 rarajes2 enabled auto-merge (squash) October 31, 2025 04:17
@rarajes2 rarajes2 merged commit c834970 into webex:next Oct 31, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

validated If the pull request is validated for automation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants