Class: FailtaleReporter::Error
- Inherits:
-
Object
- Object
- FailtaleReporter::Error
- Defined in:
- lib/failtale_reporter/error.rb
Instance Attribute Summary collapse
-
#api_token ⇒ Object
Returns the value of attribute api_token.
-
#backtrace ⇒ Object
Returns the value of attribute backtrace.
-
#description ⇒ Object
Returns the value of attribute description.
-
#environment ⇒ Object
Returns the value of attribute environment.
-
#hash_string ⇒ Object
Returns the value of attribute hash_string.
-
#name ⇒ Object
Returns the value of attribute name.
-
#properties ⇒ Object
Returns the value of attribute properties.
-
#reporter ⇒ Object
Returns the value of attribute reporter.
Instance Method Summary collapse
-
#initialize(exception, ctxs = []) ⇒ Error
constructor
A new instance of Error.
- #to_param ⇒ Object
Constructor Details
#initialize(exception, ctxs = []) ⇒ Error
Returns a new instance of Error.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/failtale_reporter/error.rb', line 12 def initialize(exception, ctxs=[]) self.api_token = FailtaleReporter.api_token self.reporter = FailtaleReporter.default_reporter self.name = "#{exception.class} #{exception.}" self.description = exception. self.backtrace = FailtaleReporter.clean_backtrace(exception.backtrace).join("\n") self.environment = ENV.to_hash self.hash_string = Digest::SHA1.hexdigest( [exception.class, exception.backtrace.first].join('--') ) FailtaleReporter.collect_information(self, ctxs) self.backtrace = self.backtrace.inspect unless self.backtrace.is_a? String self.environment = self.environment.inject({}) do |m,(k,v)| k = k.inspect unless k.is_a? String v = v.inspect unless v.is_a? String m[k] = v m end end |
Instance Attribute Details
#api_token ⇒ Object
Returns the value of attribute api_token.
3 4 5 |
# File 'lib/failtale_reporter/error.rb', line 3 def api_token @api_token end |
#backtrace ⇒ Object
Returns the value of attribute backtrace.
9 10 11 |
# File 'lib/failtale_reporter/error.rb', line 9 def backtrace @backtrace end |
#description ⇒ Object
Returns the value of attribute description.
7 8 9 |
# File 'lib/failtale_reporter/error.rb', line 7 def description @description end |
#environment ⇒ Object
Returns the value of attribute environment.
10 11 12 |
# File 'lib/failtale_reporter/error.rb', line 10 def environment @environment end |
#hash_string ⇒ Object
Returns the value of attribute hash_string.
4 5 6 |
# File 'lib/failtale_reporter/error.rb', line 4 def hash_string @hash_string end |
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/failtale_reporter/error.rb', line 5 def name @name end |
#properties ⇒ Object
Returns the value of attribute properties.
8 9 10 |
# File 'lib/failtale_reporter/error.rb', line 8 def properties @properties end |
#reporter ⇒ Object
Returns the value of attribute reporter.
6 7 8 |
# File 'lib/failtale_reporter/error.rb', line 6 def reporter @reporter end |
Instance Method Details
#to_param ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/failtale_reporter/error.rb', line 34 def to_param { :report => { :project => { :api_token => self.api_token },:error => { :hash_string => self.hash_string },:occurence => { :name => self.name, :reporter => self.reporter, :description => self.description, :backtrace => self.backtrace, :properties => self.environment } } } end |