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
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 Summary
ConstructorsConstructorDescriptionPrlApiException(int httpStatus, String message) PrlApiException(int httpStatus, String message, ApiErrorResponse detail) PrlApiException(String message) PrlApiException(String message, Throwable cause) -
Method Summary
Modifier and TypeMethodDescriptionstatic PrlApiExceptionfromResponse(int httpStatus, String rawBody, com.fasterxml.jackson.databind.ObjectMapper mapper) Parses the raw response body asApiErrorResponseand constructs an exception.Structured error detail parsed from the response body, may benull.intThe HTTP status code returned by the service, or0for network errors.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
PrlApiException
-
PrlApiException
-
PrlApiException
-
PrlApiException
-
-
Method Details
-
fromResponse
public static PrlApiException fromResponse(int httpStatus, String rawBody, com.fasterxml.jackson.databind.ObjectMapper mapper) Parses the raw response body asApiErrorResponseand 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, or0for network errors. -
getDetail
Structured error detail parsed from the response body, may benull.
-