-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Fix absence of original_exception and/or backtrace even if passed in error! #2471
Fix absence of original_exception and/or backtrace even if passed in error! #2471
Conversation
@dblock anything to add ? |
The only think that bugs me is the Error = Struct.new(:message, :status, :headers, :backtrace, :original_exception)
....
throw Errow.new(message, status, headers, backtrace, original_exception)
...
case response
when Error
when Rack::Response
else
end But this is another discussion 😛 |
Totally agree. And we can do something around that (in separate PR ofc), but I have fear that will be breaking changes. |
If its only for internal/private usage, we should be fine with the breaking changes :) |
Thanks @numbata |
I just allow that some of the grape users have something like: rescue_from do |e|
throw :error, message: "foo", status: 200, headers: {}
end or directly: get "/foo" do
throw :error, message: "oopsie", status: 200, headers: {}
end |
@@ -6,7 +6,7 @@ | |||
|
|||
#### Fixes | |||
|
|||
* Your contribution here. |
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.
Don't remove this line next time ;)
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.
🙈
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.
Let's say that I believe that there will only be new features in the next release and no fixes 🤞.
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.
Sorry about that @dblock
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.
It looks like a new "check" can be added to the "danger-changelog" gem.
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.
For sure, we take PRs :)
Ya'll are fast than me! Thanks. |
Fix the case where backtrace and/or original_exception arguments are passed, but then do not become part of the returned message, even if
backtrace: true
and/ororiginal_exception: true
are set at therescue_from
level.Fixes #2470
Thanks to @ericproulx for pointing out the problem and provided specs.