Exception: Xio::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Xio::Error
- Defined in:
- lib/xio/errors.rb
Direct Known Subclasses
Instance Method Summary collapse
- #backtrace ⇒ Object
-
#initialize(error_or_message) ⇒ Error
constructor
A new instance of Error.
- #inspect ⇒ Object
- #message ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(error_or_message) ⇒ Error
Returns a new instance of Error.
4 5 6 7 8 9 10 |
# File 'lib/xio/errors.rb', line 4 def initialize() if .is_a?(Exception) @error = else @message = end end |
Instance Method Details
#backtrace ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/xio/errors.rb', line 16 def backtrace if @error error_backtrace = ["--- Backtrace from #{@error.class} ---"] + (@error.backtrace || []) wrapper_backtrace = ["--- Backtrace from #{self.class} ---"] + (super || []) error_backtrace + wrapper_backtrace else super end end |
#inspect ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/xio/errors.rb', line 26 def inspect if @error "#{@error.inspect} (wrapped in a #{self.class})" else super end end |
#message ⇒ Object
12 13 14 |
# File 'lib/xio/errors.rb', line 12 def @message || "#{@error.class} (wrapped in a #{self.class}) - #{@error.}" end |
#to_s ⇒ Object
34 35 36 37 38 39 40 |
# File 'lib/xio/errors.rb', line 34 def to_s if @error "#{@error.class} (wrapped in a #{self.class}) - #{@error}" else super end end |