Error handling

The SDK returns errors in the following format.

type Error struct {
    Code int `json:"code"`
    Message string `json:"message"`
    Description string `json:"description"`
    UserFriendlyMessage string `json:"user_friendly_message"`
}

The following table describes the possible error types.

Error Type Description

ServerError

An error returned by the server

NetworkError

An error returned by the network

HTTPResponseError

An error returned by the HTTP client

ConfigurationError

An error returned by the SDK configuration

InvalidInputError

An error returned by the SDK when input is invalid

AuthenticationError

An error error returned by the SDK when authentication fails