Class Pain001ApiException

All Implemented Interfaces:
Serializable
Direct Known Subclasses:
GenerationRefusedException

public class Pain001ApiException extends RuntimeException
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 Details

    • Pain001ApiException

      public Pain001ApiException(int status, com.fasterxml.jackson.databind.JsonNode detail, String method, String path)
      Creates the exception.
      Parameters:
      status - the HTTP status code
      detail - the parsed detail of the error body (JSON null when absent)
      method - the HTTP method of the failed request
      path - 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 parsed detail of the error body.
      Returns:
      a string, an array (HTTP 422) or JSON null; never Java null