Deepgram.Error (Deepgram v0.1.0)

View Source

Error handling for the Deepgram SDK.

This module defines various error types that can be raised by the SDK.

Summary

Functions

Creates an API error from an HTTP response.

Creates an authentication error.

Creates a configuration error.

Creates an HTTP error.

Creates a JSON parsing error.

Creates a timeout error.

Creates a WebSocket error.

Functions

api_error(message, status_code, response_body)

@spec api_error(String.t(), integer(), String.t()) :: Deepgram.Error.ApiError.t()

Creates an API error from an HTTP response.

authentication_error(message)

@spec authentication_error(String.t()) :: Deepgram.Error.AuthenticationError.t()

Creates an authentication error.

config_error(message, key)

@spec config_error(String.t(), atom()) :: Deepgram.Error.ConfigError.t()

Creates a configuration error.

http_error(message, reason)

@spec http_error(String.t(), any()) :: Deepgram.Error.HttpError.t()

Creates an HTTP error.

json_error(message, data)

@spec json_error(String.t(), any()) :: Deepgram.Error.JsonError.t()

Creates a JSON parsing error.

timeout_error(message, timeout)

@spec timeout_error(String.t(), integer()) :: Deepgram.Error.TimeoutError.t()

Creates a timeout error.

type_error(message, expected, actual)

@spec type_error(String.t(), String.t(), String.t()) :: Deepgram.Error.TypeError.t()

Creates a type error.

websocket_error(message, reason)

@spec websocket_error(String.t(), any()) :: Deepgram.Error.WebSocketError.t()

Creates a WebSocket error.