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.



80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# 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

Instance Attribute Details

#pluginObject (readonly)

Returns the value of attribute plugin.



78
79
80
# File 'lib/doing/errors.rb', line 78

def plugin
  @plugin
end