Skip to content
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

Log source file and line info for errors in ErrorMiddleware when possible #3187

Merged
merged 4 commits into from May 10, 2024

Conversation

gwynne
Copy link
Member

@gwynne gwynne commented May 7, 2024

These changes are now available in 4.97.1

Ever since the last changes to ErrorMiddleware (by me, naturally), the error logging fails to correctly report file/line/function information even when the error has that data available. We now correctly pass these along to the logging machinery. The error responses sent to clients are unchanged.

Additional changes:

  • Restore recognition of the DebuggableError protocol (reason and source location information for such errors are now used again).
  • Handle generating error responses slightly more efficiently.
  • Include the original error message in the fallback text if encoding an error to JSON fails.
  • Improve the correctness of the reason messages used for DecodingErrors.

gwynne added 2 commits May 7, 2024 12:12
… available from the given error (will always be available on Abort errors). Don't hold a lock while doing a JSON encode.
@gwynne gwynne added enhancement New feature or request semver-patch Internal changes only labels May 7, 2024
@gwynne gwynne requested review from 0xTim, MahdiBM and ptoffy May 7, 2024 17:17
Copy link
Contributor

@MahdiBM MahdiBM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all looks good

@gwynne gwynne enabled auto-merge (squash) May 10, 2024 02:32
@gwynne gwynne merged commit e69a55b into main May 10, 2024
16 checks passed
@gwynne gwynne deleted the log-error-source-location-info branch May 10, 2024 02:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request semver-patch Internal changes only
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants