-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[Messaging logs] Better logging AggregateError #12801
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
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.
PR Summary
Enhanced error logging for AggregateError instances in token refresh operations to improve debugging capabilities.
- Added detailed AggregateError logging in
packages/twenty-server/src/modules/connected-account/refresh-tokens-manager/services/connected-account-refresh-tokens.service.ts
to capture error message, name, and individual errors array - Improved error traceability for issue #12589 by providing granular error information in catch blocks
- Maintained existing error handling logic while adding better visibility into token refresh failures
1 file reviewed, 1 comment
Edit PR Review Bot Settings | Greptile
this.logger.log(error?.errors); | ||
} else { | ||
this.logger.log(error); | ||
} | ||
throw new ConnectedAccountRefreshAccessTokenException( | ||
`Error refreshing tokens for connected account ${connectedAccount.id.slice(0, 7)} in workspace ${workspaceId.slice(0, 7)}: ${error.message} ${error?.response?.data?.error_description}`, |
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.
style: Consider including error.errors in the exception message for AggregateError to preserve the detailed error information
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.
LGTM
📊 API Changes ReportREST API ChangesSummary🔄 Changed Operations (63)
|
🚀 Preview Environment Ready! Your preview environment is available at: http://bore.pub:40852 This environment will automatically shut down when the PR is closed or after 5 hours. |
"An AggregateError in NestJS usually indicates that multiple errors were thrown or collected together and then re-thrown as a single error."
Since we have this in logs, we cannot debug properly the error #12589

That is why we will better log this errors in order to tackle them ASAP
Note: sentry errors match our Grafan logs agggregate errors as you can see