YourImageShare.APIError exception (YourImageShare v1.0.0)

Copy Markdown View Source

Raised/returned for any non-2xx response or a {"type": "error"} payload - mirrors the JS/Python/PHP/Go/Rust/Ruby SDKs' error type exactly (same status/message shape) so error-handling logic reads the same across every official SDK.

Functions in YourImageShare.Client return {:error, %APIError{}} by default (idiomatic Elixir - the tagged-tuple convention is the direct equivalent of Go's (result, error) return). Each also has a bang (!) variant that raises this struct instead, for callers who prefer that style (see e.g. File.read/1 vs File.read!/1).

Summary

Types

t()

@type t() :: %YourImageShare.APIError{
  __exception__: true,
  message: String.t(),
  status: non_neg_integer()
}