-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: error classification #50
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.
Great!
|
||
if (pgError instanceof Error && "code" in pgError) { | ||
// Connection errors | ||
if (pgError.code === "57P01" || pgError.code === "57P03") { |
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.
Just as a super nice to have and adding more context to this, Postgres error codes might change in future versions; they are more or less stable though so one error changing from one code to another is pretty weird (but it can happen).
I'd say that grouping these error codes in some kind of versioned error dictionary would be amazing, based on the version you used as a reference. That way, if for some reason someone ends up using PG 20 in the future for this, they only need to change the error dictionary in use.
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.
ooo that certainly will be a next level feature but super true. will add it to the Linear to have it tracked
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.
Great work 🫡
🤖 Linear
Closes GIT-221
Description
We make all custom exception on the project to extend Retriable or NonRetriable base errors classes
Also, we create some new exceptions where needed
Checklist before requesting a review