Package com.pain001.sdk
Class Pain001ApiException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.pain001.sdk.Pain001ApiException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
GenerationRefusedException
The server answered with a non-2xx status.
detail() is the parsed detail member of the error body: a string for most
errors, an array of request-validation errors for HTTP 422. A refused generate raises the
subclass GenerationRefusedException, whose body has no detail but carries the
findings. The exception message names only the status, method and path, never request content,
so it is safe to log.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionPain001ApiException(int status, com.fasterxml.jackson.databind.JsonNode detail, String method, String path) Creates the exception. -
Method Summary
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
Pain001ApiException
public Pain001ApiException(int status, com.fasterxml.jackson.databind.JsonNode detail, String method, String path) Creates the exception.- Parameters:
status- the HTTP status codedetail- the parseddetailof the error body (JSON null when absent)method- the HTTP method of the failed requestpath- the path of the failed request
-
-
Method Details
-
status
public int status()The HTTP status code.- Returns:
- the non-2xx status
-
detail
public com.fasterxml.jackson.databind.JsonNode detail()The parseddetailof the error body.- Returns:
- a string, an array (HTTP 422) or JSON null; never Java null
-