Exception: Inttegro::APIError

Inherits:
Error
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/inttegro/errors.rb

Direct Known Subclasses

AuthenticationError, RateLimitError

Instance Attribute Summary collapse

Attributes inherited from Error

#report

Instance Method Summary collapse

Constructor Details

#initialize(message, status:, code: nil, type: nil, url: nil, detail: nil, fix_code: nil, cause: nil, body: nil, data: nil, request_id: nil) ⇒ APIError

Returns a new instance of APIError.



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/inttegro/errors.rb', line 65

def initialize(
  message,
  status:,
  code: nil,
  type: nil,
  url: nil,
  detail: nil,
  fix_code: nil,
  cause: nil,
  body: nil,
  data: nil,
  request_id: nil
)
  super(message)
  @status = status
  @code = code
  @type = type
  @url = url
  @detail = detail
  @fix_code = fix_code
  @cause = cause
  @body = body
  @data = data
  @request_id = request_id
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



45
46
47
# File 'lib/inttegro/errors.rb', line 45

def body
  @body
end

#causeObject (readonly)

Returns the value of attribute cause.



45
46
47
# File 'lib/inttegro/errors.rb', line 45

def cause
  @cause
end

#codeObject (readonly)

Returns the value of attribute code.



45
46
47
# File 'lib/inttegro/errors.rb', line 45

def code
  @code
end

#dataObject (readonly)

Returns the value of attribute data.



48
49
50
# File 'lib/inttegro/errors.rb', line 48

def data
  @data
end

#detailObject (readonly)

Returns the value of attribute detail.



45
46
47
# File 'lib/inttegro/errors.rb', line 45

def detail
  @detail
end

#fix_codeObject (readonly)

Returns the value of attribute fix_code.



45
46
47
# File 'lib/inttegro/errors.rb', line 45

def fix_code
  @fix_code
end

#request_idObject (readonly)

Returns the value of attribute request_id.



45
46
47
# File 'lib/inttegro/errors.rb', line 45

def request_id
  @request_id
end

#statusObject (readonly)

Returns the value of attribute status.



42
43
44
# File 'lib/inttegro/errors.rb', line 42

def status
  @status
end

#typeObject (readonly)

Returns the value of attribute type.



45
46
47
# File 'lib/inttegro/errors.rb', line 45

def type
  @type
end

#urlObject (readonly)

Returns the value of attribute url.



45
46
47
# File 'lib/inttegro/errors.rb', line 45

def url
  @url
end