Class | Webgen::Error |
In: |
lib/webgen/error.rb
|
Parent: | StandardError |
Custom webgen error.
alcn | [RW] | This is either the source path or the node alcn which is responsible for the error. |
class_name | [R] | The name of the class where the error happened. |
plain_message | [R] | The plain error message. |
Create a new Error using the provided values.
If msg_or_error is a String, it is treated as the error message. If it is an exception, the exception is wrapped.
# File lib/webgen/error.rb, line 21 21: def initialize(msg_or_error, class_name = nil, alcn = nil) 22: if msg_or_error.kind_of?(String) 23: super(msg_or_error) 24: @plain_message = msg_or_error 25: else 26: super(msg_or_error.message) 27: set_backtrace(msg_or_error.backtrace) 28: @plain_message = msg_or_error.message 29: end 30: @class_name, @alcn = class_name, (alcn.kind_of?(Node) ? alcn.to_s : alcn) 31: end