Git Product home page Git Product logo

Comments (5)

dougwilson avatar dougwilson commented on September 28, 2024

We talked about it for 2 years and it's already decided to remove the feature, which is why it is deprecated.

from http-errors.

jaydenseric avatar jaydenseric commented on September 28, 2024

it's already decided to remove the feature, which is why it is deprecated.

What were the reasons for the decision?

I tried to find discussion / actual reasons for the original deprecation, but there doesn't appear to be any: https://github.com/jshttp/http-errors/search?q=deprecate&type=Issues

Your commit to master deprecating it had no reference to any issues or discussion: 858d082

Unlike deprecating, un-deprecating should not be disruptive. The "deprecation" was only advisory anyway.

from http-errors.

dougwilson avatar dougwilson commented on September 28, 2024

The discussions were on the express and koa gitter channels, I apologize.

The root of the issue is that (1) 200s are not errors and you are misusing the library and (2) it caused endless confusion for koa users because of this. You use case sounds valid for graphql, but thus module is for http semantics not graphql ones. I would suggest use a different lib for better graphql support.

from http-errors.

jaydenseric avatar jaydenseric commented on September 28, 2024

A user would have to consciously set a 200 status on the error, and so must know what they are doing. I'm not sure why anyone would get confused.

thus module is for http semantics not graphql ones

A GraphQL server sends HTTP responses like any other server. createError is used in 18 places in graphql-api-koa, only one requires a 200 status. It's not appealing to have to migrate to a different lib for this one use, especially when users already have http-errors in their node_modules.

Since the GraphQL use case is solid, and likely to become more common, why not support it? Pretty much the only change necessary is to remove the advisory deprecation notice here.

from http-errors.

dougwilson avatar dougwilson commented on September 28, 2024

Not going to happen, sorry.

from http-errors.

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.