Giter Club home page Giter Club logo

Comments (9)

krismichalski avatar krismichalski commented on September 27, 2024 1

oh, I didn't notice it was loaded there, sorry for the wrong accusation ^^" I'm glad the root cause was discovered 👍

from grape.

dblock avatar dblock commented on September 27, 2024 1

Thanks for fixing this @ericproulx.

from grape.

krismichalski avatar krismichalski commented on September 27, 2024

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.

ericproulx avatar ericproulx commented on September 27, 2024

@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.

dblock avatar dblock commented on September 27, 2024

@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.

ericproulx avatar ericproulx commented on September 27, 2024

@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.

ericproulx avatar ericproulx commented on September 27, 2024

@mscrivo could you checkout my branch and see if it works ?

from grape.

ericproulx avatar ericproulx commented on September 27, 2024

@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.

mscrivo avatar mscrivo commented on September 27, 2024

@ericproulx your branch seems to work great, our tests are passing

from grape.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.