Exception: Yamori::Rest::RequestError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/yamori/rest/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code, msg) ⇒ RequestError

Returns a new instance of RequestError.



8
9
10
11
12
# File 'lib/yamori/rest/errors.rb', line 8

def initialize(code, msg)
  @error_code = code
  @error_message  = msg
  super(to_s)
end

Instance Attribute Details

#error_codeObject (readonly)

Returns the value of attribute error_code.



7
8
9
# File 'lib/yamori/rest/errors.rb', line 7

def error_code
  @error_code
end

#error_messageObject (readonly)

Returns the value of attribute error_message.



7
8
9
# File 'lib/yamori/rest/errors.rb', line 7

def error_message
  @error_message
end

Instance Method Details

#to_sObject



14
15
16
# File 'lib/yamori/rest/errors.rb', line 14

def to_s
  %|[#{@code}] #{@msg}|
end