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

Make the PSQLError description more useful #354

Closed
trasch opened this issue Apr 28, 2023 · 2 comments · Fixed by #372
Closed

Make the PSQLError description more useful #354

trasch opened this issue Apr 28, 2023 · 2 comments · Fixed by #372
Labels
enhancement New feature or request

Comments

@trasch
Copy link
Contributor

trasch commented Apr 28, 2023

... by making it conform to CustomStringConvertible and CustomDebugStringConvertible.

Currently, print(error as! PSQLError) will print something like this:
PSQLError(backing: PostgresNIO.PSQLError.(unknown context at $100aeb99c).Backing)
which is not very helpful.

I would propose to add a description to PSQLError that uses some of the infos provided in .code, .serverInfo and other properties to convey a more helpfull message.

And I can tackle this myself, unless someone else wants to do it... 😄

@trasch trasch added the enhancement New feature or request label Apr 28, 2023
@fabianfett
Copy link
Collaborator

fabianfett commented Apr 28, 2023

Let's discuss here... And I'm happy for you to take it from there:
#356

@trasch
Copy link
Contributor Author

trasch commented May 11, 2023

gwynne added a commit to vapor/postgres-kit that referenced this issue May 15, 2023
gwynne added a commit to vapor/postgres-kit that referenced this issue May 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants