Class: Appsignal::JSExceptionTransaction
- Inherits:
-
Object
- Object
- Appsignal::JSExceptionTransaction
- Defined in:
- lib/appsignal/js_exception_transaction.rb
Instance Method Summary collapse
- #action ⇒ Object
- #clear_events! ⇒ Object
- #complete! ⇒ Object
- #convert_values_to_primitives! ⇒ Object
- #events ⇒ Object
-
#initialize(data) ⇒ JSExceptionTransaction
constructor
A new instance of JSExceptionTransaction.
- #to_hash ⇒ Object
- #type ⇒ Object
Constructor Details
#initialize(data) ⇒ JSExceptionTransaction
Returns a new instance of JSExceptionTransaction.
4 5 6 7 |
# File 'lib/appsignal/js_exception_transaction.rb', line 4 def initialize(data) @data = data @time = Time.now.to_i end |
Instance Method Details
#action ⇒ Object
13 14 15 |
# File 'lib/appsignal/js_exception_transaction.rb', line 13 def action @data['action'] end |
#clear_events! ⇒ Object
17 |
# File 'lib/appsignal/js_exception_transaction.rb', line 17 def clear_events!; end |
#complete! ⇒ Object
42 43 44 |
# File 'lib/appsignal/js_exception_transaction.rb', line 42 def complete! Appsignal.enqueue(self) end |
#convert_values_to_primitives! ⇒ Object
18 |
# File 'lib/appsignal/js_exception_transaction.rb', line 18 def convert_values_to_primitives!; end |
#events ⇒ Object
19 |
# File 'lib/appsignal/js_exception_transaction.rb', line 19 def events; []; end |
#to_hash ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/appsignal/js_exception_transaction.rb', line 21 def to_hash { :request_id => SecureRandom.uuid, :log_entry => { :action => action, :path => @data['path'], :kind => 'frontend', :time => @time, :environment => @data['environment'], :tags => @data['tags'], :revision => Appsignal.agent.revision }, :exception => { :exception => @data['name'], :message => @data['message'], :backtrace => @data['backtrace'] }, :failed => true } end |
#type ⇒ Object
9 10 11 |
# File 'lib/appsignal/js_exception_transaction.rb', line 9 def type :exception end |