Class PrlApiException

java.lang.Object
java.lang.Throwable
java.lang.Exception
com.parallels.jenkins.api.exception.PrlApiException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
PrlApiTimeoutException

public class PrlApiException extends Exception
Thrown when prl-devops-service returns a non-2xx HTTP response, or when a network-level error occurs while communicating with it.
See Also:
  • Constructor Details

    • PrlApiException

      public PrlApiException(String message)
    • PrlApiException

      public PrlApiException(int httpStatus, String message)
    • PrlApiException

      public PrlApiException(int httpStatus, String message, ApiErrorResponse detail)
    • PrlApiException

      public PrlApiException(String message, Throwable cause)
  • Method Details

    • fromResponse

      public static PrlApiException fromResponse(int httpStatus, String rawBody, com.fasterxml.jackson.databind.ObjectMapper mapper)
      Parses the raw response body as ApiErrorResponse and constructs an exception. Falls back to a plain message if the body cannot be parsed.
    • getHttpStatus

      public int getHttpStatus()
      The HTTP status code returned by the service, or 0 for network errors.
    • getDetail

      public ApiErrorResponse getDetail()
      Structured error detail parsed from the response body, may be null.