Exception: PowerTrack::BasePowerTrackError
- Inherits:
-
StandardError
- Object
- StandardError
- PowerTrack::BasePowerTrackError
- Defined in:
- lib/powertrack/errors.rb
Overview
Base PowerTrack error, capable of wrapping another
Direct Known Subclasses
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(status, msg, body = nil) ⇒ BasePowerTrackError
constructor
A new instance of BasePowerTrackError.
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
#body ⇒ Object (readonly)
Returns the value of attribute body.
4 5 6 |
# File 'lib/powertrack/errors.rb', line 4 def body @body end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
4 5 6 |
# File 'lib/powertrack/errors.rb', line 4 def status @status end |