Exception: Gat::GagetExceptions
- Inherits:
-
StandardError
- Object
- StandardError
- Gat::GagetExceptions
- Defined in:
- lib/gat/exceptions.rb
Direct Known Subclasses
GatgetArgumentException, GatgetConfigException, GatgetException, GatgetFatalException, GatgetInstanceException, GatgetProcessException, UndefinedException
Instance Attribute Summary collapse
-
#exception_backtrace ⇒ Object
readonly
Returns the value of attribute exception_backtrace.
-
#exception_location ⇒ Object
readonly
Returns the value of attribute exception_location.
-
#exception_options ⇒ Object
readonly
Returns the value of attribute exception_options.
Instance Method Summary collapse
- #exception_message ⇒ Object
- #exit_error ⇒ Object
-
#exit_level ⇒ Object
:nodoc:.
-
#initialize(error, location, options = {}) ⇒ GagetExceptions
constructor
A new instance of GagetExceptions.
Constructor Details
#initialize(error, location, options = {}) ⇒ GagetExceptions
Returns a new instance of GagetExceptions.
32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/gat/exceptions.rb', line 32 def initialize(error, location, = {}) if error.is_a?(Exception) super([:message].nil? ? error. : [:message] ) @exception_backtrace = error.backtrace else super(error) @exception_backtrace = nil end @exception_location = location @exception_options = end |
Instance Attribute Details
#exception_backtrace ⇒ Object (readonly)
Returns the value of attribute exception_backtrace.
30 31 32 |
# File 'lib/gat/exceptions.rb', line 30 def exception_backtrace @exception_backtrace end |
#exception_location ⇒ Object (readonly)
Returns the value of attribute exception_location.
28 29 30 |
# File 'lib/gat/exceptions.rb', line 28 def exception_location @exception_location end |
#exception_options ⇒ Object (readonly)
Returns the value of attribute exception_options.
29 30 31 |
# File 'lib/gat/exceptions.rb', line 29 def @exception_options end |
Instance Method Details
#exception_message ⇒ Object
44 45 46 |
# File 'lib/gat/exceptions.rb', line 44 def return end |
#exit_error ⇒ Object
52 53 54 55 56 57 58 59 60 |
# File 'lib/gat/exceptions.rb', line 52 def exit_error error_string = "ERROR: `#{ self. }` at `#{ self.exception_location }`" if self.exception_backtrace error_string << "\nBACK:\n #{ self.exception_backtrace.shift } \n #{ self.exception_backtrace.join("\n ") }" elsif self.backtrace error_string << "\nBACK:\n #{ self.backtrace.shift } \n #{ self.backtrace.join("\n ") }" end error_string end |
#exit_level ⇒ Object
:nodoc:
48 49 50 |
# File 'lib/gat/exceptions.rb', line 48 def exit_level #:nodoc: return 0 end |