class Doing::Errors::PluginException

Attributes

plugin[R]

Public Class Methods

new(msg = 'Plugin error', type = nil, plugin = nil) click to toggle source
Calls superclass method
# File lib/doing/errors.rb, line 80
def initialize(msg = 'Plugin error', type = nil, plugin = nil)
  @plugin = plugin || 'Unknown Plugin'

  type ||= 'Unknown'
  @type = case type.to_s
          when /^i/
            'Import plugin'
          when /^e/
            'Export plugin'
          when /^h/
            'Hook'
          when /^u/
            'Unrecognized'
          else
            type.to_s
          end

  msg = "(#{@type}: #{@plugin}) #{msg}"

  Doing.logger.log_now(:error, 'Plugin:', msg)

  super(msg)
end