Exception: Crowdin::API::Errors::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/crowdin-api/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(error_code, error_message) ⇒ Error

Returns a new instance of Error.



10
11
12
13
14
# File 'lib/crowdin-api/errors.rb', line 10

def initialize(error_code, error_message)
  @error_code    = error_code.to_i
  @error_message = error_message
  @message = "#{error_code}: #{error_message}"
end

Instance Attribute Details

#error_codeObject (readonly)

Returns the value of attribute error_code.



6
7
8
# File 'lib/crowdin-api/errors.rb', line 6

def error_code
  @error_code
end

#error_messageObject (readonly)

Returns the value of attribute error_message.



7
8
9
# File 'lib/crowdin-api/errors.rb', line 7

def error_message
  @error_message
end

#messageObject (readonly)

Returns the value of attribute message.



8
9
10
# File 'lib/crowdin-api/errors.rb', line 8

def message
  @message
end

Instance Method Details

#to_sObject



16
17
18
# File 'lib/crowdin-api/errors.rb', line 16

def to_s
  @message
end