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

Difficult to debug tests with db methods due to masked error messages #492

Open
finestructure opened this issue Jul 3, 2024 · 0 comments

Comments

@finestructure
Copy link
Sponsor Member

I have a number of db related unit tests that started failing due to recent changes and I find it very difficult to debug them due to the masked error messages:

2024-07-03T11:56:40+0200 debug codes.vapor.application : component=server database-id=psql psql_connection_id=2 psql_error=PSQLError – Generic description to prevent accidental leakage of sensitive data. For debugging details, use `String(reflecting: error)`. [PostgresNIO] Cleaning up and closing connection.

I understand the reason for this but there really should be an opt-out I can set in unit tests, because the recommended way of dealing with these errors is not actually actionable.

The errors are thrown and handled somewhere in the stack and a priori I don't know where, so I can't just go in and add a do { } catch { String(reflecting: error) } (leaving aside that that by itself would also be quite tedious) without a lot of digging.

Or is there a way to make this possible that I'm not aware of?

It would be great to have some means to get back to the previous, "leaky" error messages even if they're not the default.

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