Exception: Doing::Errors::PluginException

Inherits:
StandardError
  • Object
show all
Defined in:
lib/doing/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(msg = 'Plugin error', type = nil, plugin = nil) ⇒ PluginException

Returns a new instance of PluginException.



69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# 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

Instance Attribute Details

#pluginObject (readonly)

Returns the value of attribute plugin.



67
68
69
# File 'lib/doing/errors.rb', line 67

def plugin
  @plugin
end