Exception: Exception

Inherits:
Object
  • Object
show all
Defined in:
lib/laser/standard_library/exceptions.rb

Constant Summary

BT_FAILURE_MESSAGE =
"backtrace must be Array of String"

Instance Method Summary collapse

Constructor Details

#initialize(msg = nil) ⇒ Exception



2
3
4
5
# File 'lib/laser/standard_library/exceptions.rb', line 2

def initialize(msg=nil)
  @__mesg__ = msg
  @__bt__ = nil
end

Instance Method Details

#backtraceObject



6
7
8
# File 'lib/laser/standard_library/exceptions.rb', line 6

def backtrace
  @__bt__
end

#set_backtrace(new_bt) ⇒ Object



28
29
30
# File 'lib/laser/standard_library/exceptions.rb', line 28

def set_backtrace(new_bt)
  @__bt__ = __check_backtrace__(new_bt)
end

#to_sObject Also known as: message



9
10
11
12
# File 'lib/laser/standard_library/exceptions.rb', line 9

def to_s
  @__mesg__ ? (@__mesg__.to_str) : self.class.name
  #@__mesg__ ? (@__mesg__.to_s rescue @__mesg__) : self.class.name
end