Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Create base Error class for HTTP errors #286

Open
sandstrom opened this issue Apr 25, 2017 · 5 comments
Open

Create base Error class for HTTP errors #286

sandstrom opened this issue Apr 25, 2017 · 5 comments
Labels
enhancement Good for New Contributors Issue is scoped such that it can be handled by a new contributor, with the help of maintainers

Comments

@sandstrom
Copy link
Contributor

It would be useful with an isHttpError(myError) function, which would essentially be everything that isn't timeout or aborted. Would you be open to adding something like that?

@sandstrom sandstrom changed the title All http errors All HTTP errors Apr 25, 2017
@alexlafroscia
Copy link
Collaborator

Yeah, I don't see a problem there. Is a 'timeout' really not an HTTP error? Honest question, I don't know the answer to that. I totally see how 'aborted' would not be one.

@sandstrom
Copy link
Contributor Author

It's not an HTTP error in the sense that there is no HTTP status code (20x, 40x, etc). Timeouts occur in the TCP layer (connection timeouts, read timeouts) and there is no HTTP response body available.

@alexlafroscia
Copy link
Collaborator

Hmm, makes sense. If you'd like to make a PR to add this helper function, I'm happy to review it!

@sandstrom
Copy link
Contributor Author

sandstrom commented Apr 27, 2017

@alexlafroscia Given the plan to (probably) phase out the helpers in favour of instanceOf checks, it would make sense to add an intermediary class in the error hierarchy.

EmberError > AjaxError > HttpError > InvalidError // new
EmberError > AjaxError > HttpError > BadRequestError // new
EmberError > AjaxError > TimeoutError // unchanged

Just want to check if you're open to that too?

@alexlafroscia
Copy link
Collaborator

Totally, I think that's a great idea!

@alexlafroscia alexlafroscia added Good for New Contributors Issue is scoped such that it can be handled by a new contributor, with the help of maintainers enhancement labels Jun 18, 2018
@alexlafroscia alexlafroscia changed the title All HTTP errors Create base Error class for HTTP errors Jun 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Good for New Contributors Issue is scoped such that it can be handled by a new contributor, with the help of maintainers
Projects
None yet
Development

No branches or pull requests

2 participants