Package io.micronaut.http.exceptions
Class HttpStatusException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
io.micronaut.http.exceptions.HttpException
io.micronaut.http.exceptions.HttpStatusException
- All Implemented Interfaces:
Serializable
Exception thrown to return a specific HttpStatus and an error message.
- Since:
- 1.0
- Author:
- Iván López
- See Also:
-
Constructor Summary
ConstructorDescriptionHttpStatusException
(HttpStatus status, Object body) HttpStatusException
(HttpStatus status, String message) -
Method Summary
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
HttpStatusException
- Parameters:
status
- TheHttpStatus
message
- The message
-
HttpStatusException
- Parameters:
status
- TheHttpStatus
body
- The arbitrary object to return
-
-
Method Details
-
getStatus
- Returns:
- The
HttpStatus
-
getBody
- Returns:
- The optional body for the response
-