-
Notifications
You must be signed in to change notification settings - Fork 66
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
Change name/symbol of custom RaiseError class #17024
Conversation
Error: A file (or its parent directories) does not have a CODEOWNERS entry. Please update the .github/CODEOWNERS file and add the entry for the Offending file: lib/common/client/middleware/response/raise_custom_va_error.rb |
@@ -182,7 +182,7 @@ def connection(server_url:) | |||
|
|||
Faraday.new(url: server_url) do |conn| | |||
conn.use :breakers | |||
conn.response :raise_error, error_prefix: service_name, include_request: true | |||
conn.response :raise_custom_va_error, error_prefix: service_name, include_request: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kjduensing I'm including you (as a data point, not to cast blame) as an example of why this poorly named class is confusing. Can I assume that when I next update the default value of include_request
to false, you'll want me to add raise_error, include_request: true
to the new chain? I'll keep you in the loop on that PR.
Note: To be clear, the current inclusion of include_request: true
, isn't actually doing anything, as it's a default option of the Faraday class, not our class
Error: A file (or its parent directories) does not have a CODEOWNERS entry. Please update the .github/CODEOWNERS file and add the entry for the Offending file: lib/common/client/configuration/rest.rb |
Error: A file (or its parent directories) does not have a CODEOWNERS entry. Please update the .github/CODEOWNERS file and add the entry for the Offending file: lib/common/client/middleware/response/raise_custom_va_error.rb |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Name changes LGTM. After deploy, are you able to validate that this is working as designed? Check Datadog logs or something?
Summary
Faraday::Response::RaiseError
optioninclude_request
tofalse
, we need to Change the name of the customRaiseError
class for a couple of reasons:RaiseError
class registered as:raise_error
, it can be confusing for devs as that is the syntax for theFaraday::Response::RaiseError
class. In some cases our custom class has clearly been confused for the standardTo be able to use some of the extended options of the Faraday class (
include_request
and potential future options), we need to change from the explicit (former) to the more concise (latter) syntax. With the current custom class's naming convention, these would conflict. This will allow us to do something like the following, when necessary:Related issue(s)
Testing done
What areas of the site does it impact?