Giter Site home page Giter Site logo

Comments (5)

tymondesigns avatar tymondesigns commented on May 7, 2024

Hi Felix,

I definately like the idea of having the status code within the exception. Although I think it would be better to implement this without symfony's help. Since I would only be using a very small portion of the http-kernel package.

I will add the ability to access the status code in the same way that symfony does:
$exception->getStatusCode();

My plan is to try and get this package to not depend on Laravel (although Laravel setup will remain seamless).

I will let you know how it goes.

Thanks!

from jwt-auth.

pulkitjalan avatar pulkitjalan commented on May 7, 2024

I needed this also, done a pull request #17

Please can you have a look when you get some time.

from jwt-auth.

tymondesigns avatar tymondesigns commented on May 7, 2024

Thanks, #17 merged.

@felnne any thoughts ?

from jwt-auth.

felnne avatar felnne commented on May 7, 2024

Annoyingly that won't work for my use case, (using the JSON Exception Formatter package) as it only calls getStatusCode() if the exception is an instance of HttpExceptionInterface (see here).

Arguably that's an assumption on that package's part, and I accept (and agree) with your point about the full HttpException being overkill just to set a status code. However from a practical standpoint, if you're using this with Laravel you would already have this dependency.

Since my use case is focused on a specific combination of circumstances, I am happy to close this issue since the changes added do satisfy my general need, and I can adapt my exceptions to just pass through the status code. I would also probably open an issue with the other package and see if there's some way of relaxing the limitation of checking for a specific exception type.

Thanks again.

from jwt-auth.

tymondesigns avatar tymondesigns commented on May 7, 2024

Agreed it's a little presumptious on that packages' end... Closing for now, although I might reconsider down the line

from jwt-auth.

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.