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

Lower log level of events that are typically handled by application #319

Merged
merged 2 commits into from
Dec 13, 2024

Conversation

wuerges
Copy link
Contributor

@wuerges wuerges commented Nov 5, 2024

Dear @blackbeam,

I'm opening this PR to present an issue that I'm having with mysql_async.
Currently, this crate is emitting all Err variants as error! events.

Most of the time this is desirable, but sometimes this level is too severe.

When inserting duplicate values, deleting a value that is in use by another table, matching the Err variant is very convenient. A query that returns Err could be a benign error that is handled by the application, and a lower event level would be better.

This PR matches the ServerError and looks at its error code to decide whether to emit an error! or a warn!.

@blackbeam blackbeam merged commit b653339 into blackbeam:master Dec 13, 2024
15 checks passed
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