Class: RedmineAirbrakeBackend::Error

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

Overview

Error received by airbrake

Direct Known Subclasses

IosReport

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Error

Returns a new instance of Error.



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/redmine_airbrake_backend/error.rb', line 11

def initialize(data)
  # Type
  @type = data[:type]

  # Message
  @message = data[:message]

  # Backtrace
  @backtrace = data[:backtrace].map { |b| BacktraceElement.new(b) }

  # Error ID
  @id = generate_id

  # Subject
  @subject = generate_subject

  # Attachments
  @attachments = (data[:attachments].presence || []).compact

  # Application
  @application = data[:application].presence
end

Instance Attribute Details

#applicationObject (readonly)

Returns the value of attribute application.



9
10
11
# File 'lib/redmine_airbrake_backend/error.rb', line 9

def application
  @application
end

#attachmentsObject (readonly)

Returns the value of attribute attachments.



9
10
11
# File 'lib/redmine_airbrake_backend/error.rb', line 9

def attachments
  @attachments
end

#backtraceObject (readonly)

Returns the value of attribute backtrace.



8
9
10
# File 'lib/redmine_airbrake_backend/error.rb', line 8

def backtrace
  @backtrace
end

#idObject (readonly)

Returns the value of attribute id.



9
10
11
# File 'lib/redmine_airbrake_backend/error.rb', line 9

def id
  @id
end

#messageObject (readonly)

Returns the value of attribute message.



8
9
10
# File 'lib/redmine_airbrake_backend/error.rb', line 8

def message
  @message
end

#subjectObject (readonly)

Returns the value of attribute subject.



9
10
11
# File 'lib/redmine_airbrake_backend/error.rb', line 9

def subject
  @subject
end

#typeObject (readonly)

Returns the value of attribute type.



8
9
10
# File 'lib/redmine_airbrake_backend/error.rb', line 8

def type
  @type
end