Parent

Methods

Class/Module Index [+]

Quicksearch

Webgen::Error

Custom webgen error.

Attributes

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.

Public Class Methods

new(msg_or_error, class_name = nil, alcn = nil) click to toggle source

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 20
def initialize(msg_or_error, class_name = nil, alcn = nil)
  if msg_or_error.kind_of?(String)
    super(msg_or_error)
    @plain_message = msg_or_error
  else
    super(msg_or_error.message)
    set_backtrace(msg_or_error.backtrace)
    @plain_message = msg_or_error.message
  end
  @class_name, @alcn = class_name, (alcn.kind_of?(Node) ? alcn.to_s : alcn)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.