Class GenerationRefusedException

All Implemented Interfaces:
Serializable

public final class GenerationRefusedException extends Pain001ApiException
The server refused to generate a file from the data: HTTP 422 with success: false.

Since pain001 0.0.87, generate answers 422 when rows fail validation or a scheme rule. The body carries the findings, not a detail, so Pain001ApiException.detail() is JSON null and response() holds the decoded body: GenerateResponse.validationErrors() and GenerateResponse.schemeViolations(). Catching Pain001ApiException still catches this. The message names only the status, method and path, so it is safe to log.

See Also:
  • Constructor Details

    • GenerationRefusedException

      public GenerationRefusedException(GenerateResponse response, String method, String path)
      Creates the exception.
      Parameters:
      response - the decoded refusal body
      method - the HTTP method of the refused request
      path - the path of the refused request
  • Method Details

    • response

      public GenerateResponse response()
      The decoded refusal.
      Returns:
      the body: success false, no XML, and the findings