Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add HttpStatusException to control flow #25

Closed
graemerocher opened this issue Apr 19, 2018 · 1 comment
Closed

Add HttpStatusException to control flow #25

graemerocher opened this issue Apr 19, 2018 · 1 comment
Assignees
Labels
type: enhancement New feature or request

Comments

@graemerocher
Copy link
Contributor

graemerocher commented Apr 19, 2018

Currently if you want to return a custom error status you are forced to return HttpResponse object.

We should instead add a new HttpStatusException that can be thrown.

For example:

Book save(String title) {
        if(title == null) throw new HttpStatusException(HttpStatus.UNPROCESSABLE_ENTITY, "invalid title")
}
@graemerocher graemerocher added the type: enhancement New feature or request label Apr 19, 2018
@graemerocher graemerocher changed the title Add HttpStatusException to control flow Add HttpStatusException to control flow Apr 19, 2018
@jameskleeh
Copy link
Contributor

Assigned to Ivan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants