-
-
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
'context' undefined in rescue_from in 2.1.0 #2451
Comments
I believe it's because of #2363 the |
@krismichalski your close but the helper is included and loaded in Grape::Middleware::Base and Grape::Middleware::Auth::Base Nonetheless, I think I know what's the issue, since #2377, |
oh, I didn't notice it was loaded there, sorry for the wrong accusation ^^" I'm glad the root cause was discovered 👍 |
@krismichalski Looks like this isn't a bug? Can you please take a look at https://github.com/ruby-grape/grape/blob/master/UPGRADING.md and make sure it accurately describes this situation for the next person? |
For me, it feels like a bug since we narrowed the context of all |
@mscrivo could you checkout my branch and see if it works ? |
@mscrivo @krismichalski since the rescue_from's block has the context of the endpoint, you should be able to just call @dblock I think we should add it back like in my PR and add deprecation on future releases. |
@ericproulx your branch seems to work great, our tests are passing |
Thanks for fixing this @ericproulx. |
After updating from 2.0 to 2.1, some of our error handling tests broke. We have various error handlers that would catch errors globally and log some info and we used the context for that. For example:
But now with 2.1, we're getting:
I'll try to dig in tomorrow to see if I can figure out which commit caused it, but figured I'd give folks a heads up
The text was updated successfully, but these errors were encountered: