Class RadioReferenceException
java.lang.Object
java.lang.Throwable
java.lang.Exception
io.github.dsheirer.rrapi.RadioReferenceException
- All Implemented Interfaces:
Serializable
Radio reference API exception.
getErrorType() categorizes the error so that callers can decide how to react, and isRetryable()
indicates if the same request could succeed later.- See Also:
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionRadioReferenceException(RadioReferenceException.ErrorType errorType, String message) Constructs an instanceRadioReferenceException(RadioReferenceException.ErrorType errorType, String message, int httpStatusCode, Fault fault) Constructs an instanceRadioReferenceException(RadioReferenceException.ErrorType errorType, String message, Throwable throwable) Constructs an instanceRadioReferenceException(String message) Constructs an instance with error type UNKNOWNRadioReferenceException(String message, int httpStatusCode, Fault fault) Constructs an instance with the error type derived from the fault and the HTTP status codeRadioReferenceException(String message, Throwable throwable) Constructs an instance with the error type derived from the cause: TIMEOUT, INTERRUPTED, NETWORK for other I/O errors, otherwise UNKNOWN -
Method Summary
Modifier and TypeMethodDescriptionCategory of the errorgetFault()SOAP faultHTTP status codeDelay that the service requested before retrying, from the HTTP Retry-After headerbooleanhasFault()Indicates if this exception contains a SOAP faultbooleanIndicates if this exception has an HTTP status codebooleanIndicates if the same request could succeed when tried again later, e.g.withRetryAfter(Duration retryAfter) Sets the delay that the service requested before retryingMethods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
RadioReferenceException
-
RadioReferenceException
Constructs an instance with error type UNKNOWN- Parameters:
message- to report
-
RadioReferenceException
-
RadioReferenceException
Constructs an instance- Parameters:
errorType- category of the errormessage- to report
-
RadioReferenceException
public RadioReferenceException(RadioReferenceException.ErrorType errorType, String message, Throwable throwable) Constructs an instance- Parameters:
errorType- category of the errormessage- to reportthrowable- cause
-
RadioReferenceException
public RadioReferenceException(RadioReferenceException.ErrorType errorType, String message, int httpStatusCode, Fault fault) Constructs an instance- Parameters:
errorType- category of the errormessage- to reporthttpStatusCode- of the responsefault- being reported, or null
-
-
Method Details
-
getErrorType
Category of the error -
isRetryable
public boolean isRetryable()Indicates if the same request could succeed when tried again later, e.g. after a timeout or a service error. False for errors that need a change first, e.g. invalid credentials or an invalid id. -
getRetryAfter
-
withRetryAfter
Sets the delay that the service requested before retrying- Parameters:
retryAfter- delay or null- Returns:
- this exception
-
getHttpStatusCode
-
hasHttpStatusCode
public boolean hasHttpStatusCode()Indicates if this exception has an HTTP status code- Returns:
- true if non-null
-
getFault
-
hasFault
public boolean hasFault()Indicates if this exception contains a SOAP fault- Returns:
- true if non-null
-