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

Rename Faraday::Logger::Formatter#error to #exception #1468

Merged
merged 2 commits into from
Dec 14, 2022

Conversation

iMacTia
Copy link
Member

@iMacTia iMacTia commented Dec 13, 2022

Description

Rename Faraday::Logger::Formatter#error to #exception
This is because #error is already delegated to the internal Logger, and could cause an infinite loop when the log_level is set to "error".

Fixes #1467

Additional Notes

Although this is technically a breaking change, I'll still release this as a hotfix release (2.7.2) because of the following:

  1. The Middleware API is unchanged (on_error)
  2. The current implementation could cause infinite loops if the log_level is set to "error"
  3. The only affected projects will have a custom formatter implementing the error method. Considering this feature was released very recently, the chances of this happening are extremely small.

cc @epaew in case you've built a custom formatter following your PR

This is because #error is already delegated to the internal Logger, and could cause an infinite loop when the log_level is set to "error".

Fixes #1467
@iMacTia iMacTia requested a review from olleolleolle December 13, 2022 17:59
@iMacTia iMacTia self-assigned this Dec 13, 2022
Copy link
Member

@olleolleolle olleolleolle left a comment

Choose a reason for hiding this comment

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

Good thinking!

This is a good evolution.

@iMacTia iMacTia merged commit c02a104 into main Dec 14, 2022
@iMacTia iMacTia deleted the fix/#1467-formatter-error-redefined branch December 14, 2022 09:48
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.

Faraday 2.7.1 causes following warning: "warning: method redefined; discarding old error"
2 participants