Exception: ForestAdminAgent::Http::Exceptions::BusinessError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/forest_admin_agent/http/Exceptions/business_error.rb

Overview

Parent class for all business errors This is the base class that all specific error types inherit from

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, details: {}, cause: nil) ⇒ BusinessError

Returns a new instance of BusinessError.



9
10
11
12
13
# File 'lib/forest_admin_agent/http/Exceptions/business_error.rb', line 9

def initialize(message = nil, details: {}, cause: nil)
  super(message)
  @details = details || {}
  @cause = cause
end

Instance Attribute Details

#causeObject (readonly)

Returns the value of attribute cause.



7
8
9
# File 'lib/forest_admin_agent/http/Exceptions/business_error.rb', line 7

def cause
  @cause
end

#detailsObject (readonly)

Returns the value of attribute details.



7
8
9
# File 'lib/forest_admin_agent/http/Exceptions/business_error.rb', line 7

def details
  @details
end

Instance Method Details

#nameObject

Returns the name of the error class



16
17
18
# File 'lib/forest_admin_agent/http/Exceptions/business_error.rb', line 16

def name
  self.class.name.split('::').last
end