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

chore(server): errors for database append additional context #3698

Merged
merged 2 commits into from
Dec 16, 2024

Conversation

iainsproat
Copy link
Contributor

@iainsproat iainsproat commented Dec 14, 2024

Description & motivation

When database errors are thrown it is difficult to determine the context in which the error occurred. This includes context about the database the client was attempting to connect to and the current state of the connection pool in the client.
This information would greatly aid in debugging database related issues.

Changes:

  • DatabaseError now requires the database client to be passed to it. The DatabaseError now attempts to gather additional context information and append it to the metadata information on the error.
  • If additional data cannot be retrieved it is ignored and the error is created as before without additional information.

To-do before merge:

Screenshots:

Validation of changes:

When run locally against a non-existent database:

Screenshot 2024-12-14 at 13 16 08

Checklist:

  • My pull request follows the guidelines in the Contributing guide?
  • My pull request does not duplicate any other open Pull Requests for the same update/change?
  • My commits are related to the pull request and do not amend unrelated code or documentation.
  • My code follows a similar style to existing code.
  • I have added appropriate tests.
  • I have updated or added relevant documentation.

References

@iainsproat iainsproat marked this pull request as ready for review December 14, 2024 13:48
@iainsproat iainsproat merged commit 6d3ba0d into main Dec 16, 2024
26 of 28 checks passed
@iainsproat iainsproat deleted the iain/improve-error-info-database-migrations branch December 16, 2024 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants