YouTubeTranscriptNet.Error exception (youtubetranscript_net v0.1.0)

Copy Markdown View Source

The only error the SDK returns (and raises from YouTubeTranscriptNet.new!/1).

  • :status - HTTP status, 0 for errors raised locally
  • :code - the server's error.code, or HTTP_<status>, NETWORK_ERROR, TIMEOUT, API_KEY_REQUIRED, INVALID_REQUEST, INVALID_RESPONSE, TRANSCRIPT_FAILED
  • :message - a readable message
  • :request_id - the X-Request-Id response header; include it when you contact support
  • :retry_after - seconds from Retry-After, or nil
  • :details - the server's error object as-is ("availableLanguages", "creditsRequired", ...)
  • :job_id - set on TIMEOUT and failed jobs when a job was involved
  • :retryable - true for 429, 5xx and NETWORK_ERROR

Summary

Functions

True for 429, 5xx and NETWORK_ERROR.

Types

t()

@type t() :: %YouTubeTranscriptNet.Error{
  __exception__: term(),
  code: String.t(),
  details: map() | nil,
  job_id: String.t() | nil,
  message: String.t(),
  request_id: String.t() | nil,
  retry_after: number() | nil,
  retryable: boolean(),
  status: non_neg_integer()
}

Functions

retryable?(error)

@spec retryable?(t()) :: boolean()

True for 429, 5xx and NETWORK_ERROR.