Package org.apache.juneau.bean.rfc7807
Class ProblemException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.apache.juneau.bean.rfc7807.ProblemException
- All Implemented Interfaces:
Serializable
A
RuntimeException that carries an
RFC 7807 Problem payload.
Lets handlers throw a custom problem without manually building a BasicHttpException:
The wrapped Problem is recovered via getProblem(). Lives in the bean module
(no juneau-rest-server dep); the server-side processor recognises ProblemException and unwraps it
for serialization.
See Also:
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the wrappedProblempayload.static ProblemExceptionConvenience factory.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
ProblemException
Constructor.- Parameters:
problem- The problem payload to carry. May benull , though callers should normally supply a populatedProblem.
-
-
Method Details
-
of
Convenience factory.- Parameters:
problem- The problem payload to carry. May benull .- Returns:
- A new
ProblemExceptionwrappingproblem.
-
getProblem
Returns the wrappedProblempayload.- Returns:
- The problem payload, or
null if none was supplied at construction.
-