class CloudConvert::Error

Constants

BadGateway

Raised when CloudConvert returns the HTTP status code 502

BadRequest

Raised when CloudConvert returns the HTTP status code 400

ClientError

Raised when CloudConvert returns a 4xx HTTP status code

ERRORS
Forbidden

Raised when CloudConvert returns the HTTP status code 403

GatewayTimeout

Raised when CloudConvert returns the HTTP status code 504

InternalServerError

Raised when CloudConvert returns the HTTP status code 500

InvalidMedia

Raised when CloudConvert returns an InvalidMedia error

MediaError

Raised when CloudConvert returns a media related error

MediaInternalError

Raised when CloudConvert returns a media InternalError error

NotAcceptable

Raised when CloudConvert returns the HTTP status code 406

NotFound

Raised when CloudConvert returns the HTTP status code 404

PaymentRequired

Raised when CloudConvert returns the HTTP status code 402

RequestEntityTooLarge

Raised when CloudConvert returns the HTTP status code 413

ServerError

Raised when CloudConvert returns a 5xx HTTP status code

ServiceUnavailable

Raised when CloudConvert returns the HTTP status code 503

TimeoutError

Raised when an operation subject to timeout takes too long

TooManyRequests

Raised when CloudConvert returns the HTTP status code 429

Unauthorized

Raised when CloudConvert returns the HTTP status code 401

UnprocessableEntity

Raised when CloudConvert returns the HTTP status code 422

UnsupportedMedia

Raised when CloudConvert returns an UnsupportedMedia error

Attributes

code[R]

@return [Integer]

errors[R]

@return [OpenStruct]

Public Class Methods

from_response(response) click to toggle source

Create a new error from an HTTP response

@param response [Faraday::Response] @return [CloudConvert::Error]

# File lib/cloudconvert/error.rb, line 90
def from_response(response)
  klass = ERRORS[response.status] || self
  klass.new(response.body.message, response.body.code, response.body.errors)
end
new(message = "", code = nil, errors = {}) click to toggle source

Initializes a new Error object

@param message [Exception, String] @param code [Integer] @return [CloudConvert::Error]

Calls superclass method
# File lib/cloudconvert/error.rb, line 101
def initialize(message = "", code = nil, errors = {})
  super(message)

  @code = code
  @errors = errors
end