Class QTSError

All Implemented Interfaces:
Serializable
Direct Known Subclasses:
QTSAuthError, QTSCanceledError, QTSDownloadError, QTSExecutionError, QTSPreparationError, QTSStrategyCompileError, QTSTimeoutError, QTSUploadError

public class QTSError extends RuntimeException
Root of the QTSurfer SDK exception hierarchy. All SDK errors are unchecked; consumers can catch QTSError to handle any SDK-specific failure, or match on subclasses to react to a specific stage.
See Also:
  • Constructor Details

    • QTSError

      public QTSError(String message)
    • QTSError

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

    • getStatusCode

      public OptionalInt getStatusCode()
      Returns:
      the HTTP status when this error originated in an API response
    • getResponseError

      public Optional<com.qtsurfer.api.client.model.ResponseError> getResponseError()
      Returns:
      the structured server error when the response body has that shape
    • getInsufficientScopeError

      public Optional<com.qtsurfer.api.client.model.InsufficientScopeError> getInsufficientScopeError()
      Returns:
      the typed 403 error when an operation is missing a required API-key scope
    • getPlanRequiredError

      public Optional<com.qtsurfer.api.client.model.PlanRequiredError> getPlanRequiredError()
      Returns:
      the typed plan-entitlement error when the API rejected the request with 402
    • getUpgradeUrl

      public Optional<URI> getUpgradeUrl()
      Returns:
      the plan-change page supplied by the API, when configured for this environment
    • getRequiredScope

      public Optional<String> getRequiredScope()
      Returns:
      the missing resource/action grant, when this is an insufficient-scope error
    • getMessage

      public String getMessage()
      Overrides:
      getMessage in class Throwable
    • getRetryable

      public Optional<Boolean> getRetryable()
      Returns:
      whether the API marks the same request as retryable
    • getReason

      public Optional<String> getReason()
      Returns:
      a stable cause token; handle unknown tokens like an absent reason
    • getNext

      public Optional<com.qtsurfer.api.client.model.ErrorNextCall> getNext()
      Returns:
      a suggested recovery request; the SDK never executes it automatically
    • getResponseHeaders

      public Optional<HttpHeaders> getResponseHeaders()
      Returns:
      response headers, including Retry-After, when available