OvokException

Base class of every exception the SDK throws; carries the API's error details when there is a response.

  • Stable unknown
  • Release candidate since 0.1.0-rc.4
  • Development since 0.1.0-dev.24+fa54770
public class OvokException extends RuntimeException

Base class of every exception the SDK throws; carries the API's error details when there is a response.

Constructors

OvokException

public OvokException(String message)

Creates an exception with only a message.

Parameters:

  • message: the error message
public OvokException(
        String message,
        Integer status,
        String code,
        String type,
        String traceId,
        String requestId,
        Duration retryAfter,
        String body,
        Throwable cause)

Creates an exception with the API's error details.

Parameters:

  • message: the error message
  • status: the HTTP status, or null
  • code: the error code from the response body, or null
  • type: the error type from the response body, or null
  • traceId: the x-trace-id response header, or null
  • requestId: the x-request-id response header, or null
  • retryAfter: the Retry-After delay, or null
  • body: the raw response body, or null
  • cause: the underlying cause, or null

Methods

status

public Integer status()

Returns the HTTP status.

Returns: the status, or null when there was no response

code

public String code()

Returns the error code from the response body.

Returns: the code, or null

type

public String type()

Returns the error type from the response body.

Returns: the type, or null

traceId

public String traceId()

Returns the x-trace-id response header, for support requests.

Returns: the trace id, or null

requestId

public String requestId()

Returns the x-request-id response header, for support requests.

Returns: the request id, or null

retryAfter

public Duration retryAfter()

Returns how long to wait before retrying, from the Retry-After header.

Returns: the delay, or null when the response did not set one

body

public String body()

Returns the raw response body.

Returns: the body, or null

Last updated on

On this page