Exception: Cdek::ApiError

Inherits:
Error
  • Object
show all
Defined in:
lib/cdek/error.rb

Overview

Ошибка ответа API. Доступны статус, тело и массив ошибок CDEK.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, status: nil, body: nil, errors: nil) ⇒ ApiError

Returns a new instance of ApiError.



14
15
16
17
18
19
# File 'lib/cdek/error.rb', line 14

def initialize(message, status: nil, body: nil, errors: nil)
  super(message)
  @status = status
  @body = body
  @errors = errors
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



12
13
14
# File 'lib/cdek/error.rb', line 12

def body
  @body
end

#errorsObject (readonly)

Returns the value of attribute errors.



12
13
14
# File 'lib/cdek/error.rb', line 12

def errors
  @errors
end

#statusObject (readonly)

Returns the value of attribute status.



12
13
14
# File 'lib/cdek/error.rb', line 12

def status
  @status
end