Comments (9)
oh, I didn't notice it was loaded there, sorry for the wrong accusation ^^" I'm glad the root cause was discovered 👍
from grape.
Thanks for fixing this @ericproulx.
from grape.
I believe it's because of #2363 the Grape::Middleware::Helpers
module is no longer eager loaded. Adding helpers Grape::Middleware::Helpers
fixes the issue.
from grape.
@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, rescue_from
are endpoint.instance_exec
instead of instance_exec
. Since the endpoint doesn't have the helper included, adding helpers Grape::Middleware::Helpers
makes it work.
from grape.
@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?
from grape.
@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 rescue_from
to the endpoint. I've made a fix which is very simple
from grape.
@mscrivo could you checkout my branch and see if it works ?
from grape.
@mscrivo @krismichalski since the rescue_from's block has the context of the endpoint, you should be able to just call env
directly instead of context.env
.
@dblock I think we should add it back like in my PR and add deprecation on future releases.
from grape.
@ericproulx your branch seems to work great, our tests are passing
from grape.
Related Issues (20)
- Routing priority issue in Grape v2.1.0 when using with rails HOT 13
- Minor release ? HOT 1
- Grape::Util::Accept::Header : empty range in char class: /^([a-z*]+)\/([a-z0-9*&\^\- HOT 2
- Error messages depends on previous requests HOT 2
- Broken Params Type Check in Grape v2.1.x HOT 1
- Coverage is only covering specs
- original_exception and backtrace are not present even if passed in error! HOT 1
- Error when rescue Grape::Exceptions::ValidationErrors in json format with backtrance and original_exception HOT 4
- Error when validating array items with different conditionally required properties HOT 6
- Wrong quality ranking when q parameter is not a float
- Returning an invalid response in a `rescue_from` block causes “NoMethodError: undefined method 'default_rescue_handler'” HOT 5
- Danger missing write access HOT 1
- NoMethodError for nil:NilClass on headers.reverse_merge after upgrading Grape from 1.6.2 to 1.8.0 HOT 6
- How to handle exception raised in `rescue_from` block? HOT 4
- Formatting with multi_json ? HOT 4
- Include Rack::TempFileReaper in Grape ?
- Parsing query params may lead to unhandled Rack exception.
- Enforce MFA when releasing ? HOT 1
- Grape 2.1.x fail to compile, NoMethodError: undefined method `[]' for nil in grape/dsl/inside_route.rb:421:in `route' HOT 8
- Performance degradation with mustermann HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grape.