Package com.helger.phase4.util
Class Phase4IncomingException
java.lang.Object
java.lang.Throwable
java.lang.Exception
com.helger.phase4.util.Phase4Exception
com.helger.phase4.util.Phase4IncomingException
- All Implemented Interfaces:
Serializable
Special phase4 incoming exception for inbound errors. It adds an HTTP response code to the return
values.
- Since:
- 4.1.2
- Author:
- Philip Helger
- See Also:
-
Field Summary
Fields inherited from class com.helger.phase4.util.Phase4Exception
DEFAULT_RETRY_FEASIBLE -
Constructor Summary
ConstructorsConstructorDescriptionPhase4IncomingException(@NonNull String sMessage) Phase4IncomingException(@NonNull String sMessage, @Nullable Throwable aCause) -
Method Summary
Modifier and TypeMethodDescriptionfinal intfinal booleanfinal @NonNull Phase4IncomingExceptionsetHttpStatusCode(int n) Set the HTTP Status code to be used.Methods inherited from class com.helger.phase4.util.Phase4Exception
isRetryFeasible, setRetryFeasibleMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
Phase4IncomingException
- Parameters:
sMessage- Error message
-
Phase4IncomingException
- Parameters:
sMessage- Error messageaCause- Optional causing exception
-
-
Method Details
-
getHttpStatusCode
@CheckForSigned public final int getHttpStatusCode()- Returns:
- The HTTP status code to be returned. All values ≤ 0 means: undefined.
-
hasHttpStatusCode
public final boolean hasHttpStatusCode()- Returns:
trueif a defined HTTP status code is present,falseotherwise.
-
setHttpStatusCode
Set the HTTP Status code to be used.- Parameters:
n- The HTTP status code to be used. Any value ≤ 0 means to use the default.- Returns:
- this for chaining
-