Exception: PackAPI::InternalError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/pack_api/internal_error.rb

Overview

Error class for passing errors from the model to the API logic

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(msg = nil, object: nil, options: {}) ⇒ InternalError

Returns a new instance of InternalError.



9
10
11
12
13
# File 'lib/pack_api/internal_error.rb', line 9

def initialize(msg = nil, object: nil, options: {})
  super(msg)
  @object = object
  @options = options
end

Instance Attribute Details

#objectObject (readonly)

Returns the value of attribute object.



7
8
9
# File 'lib/pack_api/internal_error.rb', line 7

def object
  @object
end

#optionsObject (readonly)

Returns the value of attribute options.



7
8
9
# File 'lib/pack_api/internal_error.rb', line 7

def options
  @options
end

Instance Method Details

#messageObject



15
16
17
# File 'lib/pack_api/internal_error.rb', line 15

def message
  to_s
end

#to_sObject



19
20
21
22
23
# File 'lib/pack_api/internal_error.rb', line 19

def to_s
  return super unless object.present?

  "#{super} - #{object.inspect}"
end