Package io.wcm.caravan.pipeline
Class JsonPipelineInputException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- io.wcm.caravan.pipeline.JsonPipelineInputException
-
- All Implemented Interfaces:
Serializable
@ProviderType public final class JsonPipelineInputException extends RuntimeException
Used to indicate that the JSON input data of aJsonPipeline
could not be retrieved, was invalid JSON, or didn't match the expected data structure.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description JsonPipelineInputException(int statusCode, String msg)
JsonPipelineInputException(int statusCode, String msg, Throwable cause)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getReason()
int
getStatusCode()
Provides the appropriate status code for this exception.JsonPipelineInputException
setReason(String reasonPhrase)
-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
JsonPipelineInputException
public JsonPipelineInputException(int statusCode, String msg)
- Parameters:
statusCode
- the status code to use in the HTTP responsemsg
- the error message (that will also be used as reason string in the HTTP response)
-
-
Method Detail
-
getStatusCode
public int getStatusCode()
Provides the appropriate status code for this exception. If the underlying HTTP request fails, the status code will be taken from the HTTP response. If JSON parsing or object mapping failed, the status code will be 500.- Returns:
- the HTTP status code
-
getReason
public String getReason()
- Returns:
- exception reason.
-
setReason
public JsonPipelineInputException setReason(String reasonPhrase)
- Parameters:
reasonPhrase
- the reason line from the HTTP response headers- Returns:
- this
-
-