Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Currency handling fix #1097
Currency handling fix #1097
Changes from all commits
977fadf
a8182d8
08275ca
5f6b6e0
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Would be good to assert the error code and the error type as well for the multiple currency warning
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.
That may be a bit overkill. A lot would have to go wrong to get an error with that message, but somehow not have the correct code/type.
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.
Well, I was suggesting for those assertions more to safeguard us from situations where somebody touching that code and potentially changing the error type for it, from
warning
to something else, maybe a fatal error type, then the tests can help catch that.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.
If someone just randomly changes the error type, that is a pretty blatant and silly change. If it something more subtle like the error code changing, then the test will probably target the new code, unless something really subtle is going on. In any case, I had already beefed up the test since it wasn't much work.
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.
This is just a question I have: Warning seems to be more generic than other code listed here. Should it rather be scoped to the currency warning? Something like
OneCurrencySupportedCode
or anything like that?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.
The most generic error code is not having a code at all. The purpose of the error codes is to aid in automation, that is a client making the requests and receiving the responses can just look at the code rather than parse out the error message and behave accordingly. I would not have added the code at all except we have a piece of code that whitelists which error codes are not fatal codes, and the request can continue. So I felt a generic warning code would cover all the use cases and keep us from generating more codes in the future that will not be used for anything beyond adding to the non-fatal white list.
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.
Alright :)