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

Log handled errors to warning #1926

Merged
merged 3 commits into from
May 27, 2024
Merged

Log handled errors to warning #1926

merged 3 commits into from
May 27, 2024

Conversation

alfechner
Copy link
Contributor

Fixes #1925.

Changes proposed in this pull request:

  • Log handled errors to warning instead of error.
  • Log validation errors to info because the intent of the log lines in informational. The error is handled by raising a new error.

@alfechner alfechner changed the title Log handled errors to warning. Closes #1925. Log handled errors to warning May 14, 2024
@coveralls
Copy link

coveralls commented May 14, 2024

Coverage Status

coverage: 94.179% (-0.02%) from 94.197%
when pulling 1c3e44c on alfechner:main
into 562fff0 on spec-first:main.

Copy link
Member

@Ruwann Ruwann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

I left one comment for a log that I would keep on something more severe than info.

connexion/validators/json.py Outdated Show resolved Hide resolved
@alfechner
Copy link
Contributor Author

@Ruwann kind reminder to merge 🙏 🙇

Copy link
Member

@RobbeSneyders RobbeSneyders left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @alfechner!

@RobbeSneyders RobbeSneyders merged commit 810a980 into spec-first:main May 27, 2024
7 of 8 checks passed
RobbeSneyders pushed a commit that referenced this pull request May 27, 2024
Fixes #1925.

Changes proposed in this pull request:

 - Log handled errors to `warning` instead of `error`.
- Log validation errors to `info` because the intent of the log lines in
informational. The error is handled by raising a new error.

---------

Co-authored-by: Alex Fechner <alex.fechner@stryker.com>
@@ -68,7 +68,7 @@ def _validate(self, body: t.Any) -> t.Optional[dict]:
return self._validator.validate(body)
except ValidationError as exception:
error_path_msg = format_error_with_path(exception=exception)
logger.error(
logger.info(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to configure this, as I'd quite like it as a warning; but not an error, and it's clear to me from this that many people may have different use-cases. I Know I can redirect a log-stream.

Ruwann pushed a commit that referenced this pull request May 28, 2024
…#1926. (#1935)

@RobbeSneyders, @Ruwann sorry for this, it seems like I've sneaked in a
duplicate log statement in PR #1926 🙇‍♂️

---------

Co-authored-by: Alex Fechner <alex.fechner@stryker.com>
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.

Error Logging
5 participants