feat: Include details for web api errors#483
feat: Include details for web api errors#483kevinrobayna wants to merge 1 commit intoslack-ruby:masterfrom
Conversation
fixes: slack-ruby#482 Currently when we get the error message we get no details of what went wrong unless we get the response_metadata for the error which is not intuitive as most people when they get an error and print the exception they would expect to see as much details as possible. Additionally updated ruby-version in the project to be the latest as most people would be using that one as their default, though not changing the one required by the gem
| response.body.response_metadata | ||
| end | ||
|
|
||
| def to_s |
There was a problem hiding this comment.
the approach I took here is to put as many details as possible but without empty details i.e. the errors list would not be added if there are none, same as the response metadata.
| @@ -1 +1 @@ | |||
| 2.7.6 | |||
| 3.2.0 | |||
There was a problem hiding this comment.
let me know if you want me to remove this from the PR 😅
There was a problem hiding this comment.
Probably, but this is just the default version being used, it has little consequence on anything. We should probably just delete this file.
dblock
left a comment
There was a problem hiding this comment.
Add some specs with actual text? Let's see how it looks?
If we're going to start returning complex detailed errors we should adopt a better structured approach and even support localization. Check out https://github.com/dblock/ruby-enum/blob/master/lib/ruby-enum/errors/base.rb and how it constructs errors, I would copy everything from there.
fixes: #482
Currently when we get the error message we get no details of what went wrong unless we get the response_metadata for the error which is not intuitive as most people when they get an error and print the exception they would expect to see as much details as possible.
Additionally updated ruby-version in the project to be the latest as most people would be using that one as their default, though not changing the one required by the gem