Class: ElasticNotifier::Error

Inherits:
Signal
  • Object
show all
Defined in:
lib/elastic_notifier/error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Signal

#to_hash

Constructor Details

#initialize(error, overrides = {}) ⇒ Error

Returns a new instance of Error.



5
6
7
8
# File 'lib/elastic_notifier/error.rb', line 5

def initialize(error, overrides = {})
  super(overrides)
  @error = error
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



3
4
5
# File 'lib/elastic_notifier/error.rb', line 3

def attributes
  @attributes
end

Instance Method Details

#dataObject



14
15
16
17
18
19
20
# File 'lib/elastic_notifier/error.rb', line 14

def data
  { 
    name: @error.class.name,
    message: @error.message,
    backtrace: @error.backtrace
  }
end

#severityObject



10
11
12
# File 'lib/elastic_notifier/error.rb', line 10

def severity
  'error'
end