Exception: Less::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Less::Error
- Defined in:
- lib/less/errors.rb
Direct Known Subclasses
Instance Method Summary collapse
- #backtrace ⇒ Object
- #cause ⇒ Object
-
#initialize(cause, value = nil) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(cause, value = nil) ⇒ Error
Returns a new instance of Error.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/less/errors.rb', line 5 def initialize(cause, value = nil) @value = value = nil if @value # 2 args passed = @value['message'] else # allow passing only value as first arg cause : if cause.respond_to?(:'[]') && = cause['message'] @value = cause end end if cause.is_a?(::Exception) @cause = cause super( || cause.) else super( || cause) end end |
Instance Method Details
#backtrace ⇒ Object
28 29 30 |
# File 'lib/less/errors.rb', line 28 def backtrace @cause ? @cause.backtrace : super end |
#cause ⇒ Object
24 25 26 |
# File 'lib/less/errors.rb', line 24 def cause @cause end |