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

Review error handling #3

Closed
jackc opened this issue Jun 22, 2019 · 1 comment
Closed

Review error handling #3

jackc opened this issue Jun 22, 2019 · 1 comment
Milestone

Comments

@jackc
Copy link
Owner

jackc commented Jun 22, 2019

Errors are part of the package interface. Review to consider if errors are being exposed that shouldn't be or if there are new types or interfaces that should be.

The current error structure uses golang.org/x/xerrors to use the proposed Go 1.13 error system. PgError is the only exposed error type. There are several sentinel error values. At the moment all error checking must be performed with Is or As because of possible wrapping.

golang/go#29934
golang/go#32405

@jackc jackc added this to the v1 milestone Jun 22, 2019
@jackc
Copy link
Owner Author

jackc commented Aug 27, 2019

Added some internally strong types for errors and added helper functions for checking if it is safe to retry after an error and if an error was caused by a timeout.

138254d

@jackc jackc closed this as completed Aug 27, 2019
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

No branches or pull requests

1 participant