Exception: PowerTrack::BasePowerTrackError

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

Overview

Base PowerTrack error, capable of wrapping another

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status, msg, body = nil) ⇒ BasePowerTrackError

Returns a new instance of BasePowerTrackError.



6
7
8
9
10
11
12
13
14
# File 'lib/powertrack/errors.rb', line 6

def initialize(status, msg, body=nil)
  msg ||= body
  _status = "#{status}".strip
  _msg = "#{msg}".strip
  err = [ _status, _msg ].select { |part| !part.empty? }.join(': ')
  super(err)
  @status = status
  @body = body
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



4
5
6
# File 'lib/powertrack/errors.rb', line 4

def body
  @body
end

#statusObject (readonly)

Returns the value of attribute status.



4
5
6
# File 'lib/powertrack/errors.rb', line 4

def status
  @status
end