class Doing::Errors::PluginException

Attributes

plugin[R]

Public Class Methods

new(msg = 'Plugin error', type = nil, plugin = nil) click to toggle source
# File lib/doing/errors.rb, line 69
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'
          else
            type.to_s
          end

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

  Doing.logger.log_now(:error, 'Plugin:', msg)
  Process.exit 1
end