Exception: ApiException::BaseException

Inherits:
StandardError
  • Object
show all
Includes:
ActiveModel::Model, ActiveModel::Serialization
Defined in:
lib/api_exception/base_exception.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(error_type, errors, params = {}, platform = "API") ⇒ BaseException



8
9
10
11
12
# File 'lib/api_exception/base_exception.rb', line 8

def initialize(error_type, errors, params = {}, platform = "API")
  @error = error_code_map[error_type]

  define_attributes(error_type, errors, params, platform)
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



6
7
8
# File 'lib/api_exception/base_exception.rb', line 6

def code
  @code
end

#error_typeObject (readonly)

Returns the value of attribute error_type.



6
7
8
# File 'lib/api_exception/base_exception.rb', line 6

def error_type
  @error_type
end

#errorsObject (readonly)

Returns the value of attribute errors.



6
7
8
# File 'lib/api_exception/base_exception.rb', line 6

def errors
  @errors
end

#messageObject (readonly)

Returns the value of attribute message.



6
7
8
# File 'lib/api_exception/base_exception.rb', line 6

def message
  @message
end

#typeObject (readonly)

Returns the value of attribute type.



6
7
8
# File 'lib/api_exception/base_exception.rb', line 6

def type
  @type
end