Comments (5)
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.
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.
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.
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.
Not going to happen, sorry.
from http-errors.
Related Issues (20)
- Include typescript typings in the package
- Cannot subclass errors HOT 1
- How to send the message in different structure ? HOT 3
- Interface changes HOT 4
- Broken tests for Node@8 and Node@9
- Remove legacy dependencies? HOT 1
- Feature Request: Ability to attach custom properties to named errors HOT 4
- Always returning status code 500 HOT 1
- [Feature Request] Support "errors" inside properties HOT 3
- support new createError.BadRequest(obj) HOT 2
- Create release for new `isHttpError` HOT 6
- Guard Error.captureStackTrace() HOT 2
- Question: Support "errors" inside properties HOT 1
- Add "expose" to "new createError.[code || name]([msg]))" syntax HOT 1
- Support for Error.cause HOT 3
- populateConstructorExports calls toIdentifier with unknown HOT 13
- A low-level question HOT 2
- httpError(N, error) is misleading if error is already an HTTP error HOT 2
- Migrate to ES6 classes HOT 2
- Allow HttpError extension by ES6 classes HOT 2
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 http-errors.