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

Don't interpret exception codes as http statuscodes #31

Closed
wants to merge 2 commits into from
Closed

Don't interpret exception codes as http statuscodes #31

wants to merge 2 commits into from

Conversation

BreiteSeite
Copy link
Contributor

This PR should fix issue #27.

ProblemExceptionInterface got a new Method getHttpStatusCode() to give transport the http status in your exception. If Exceptions are converted into a ApiProblem-Response, which aren't implementing the ProblemExceptionInterface, we just use the HTTP status code 500.

@weierophinney
Copy link
Member

This is a backwards compatibility break (adding new method to an interface). As such, I cannot merge it.

I'm also not convinced it's necessary. Most of the time, developers will not set an exception code, which will result in a 500 status already. If they do set a code, it would need to be inside the HTTP status code range (100-599 inclusive) to be used anyways; anything else also results in a 500.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants