failbot 2.4.0 → 2.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 72511c74e8a4c9b1dd06d9408c0c926568382e8e72cd3e3a28b7d262835e9aef
4
- data.tar.gz: 649f8f43daedeb3044cc1457b09948b9f354db737e73e5b512a1ad2f90850684
3
+ metadata.gz: d8b0cb0e395a797b15f920bf62da3a4bc56a92545000e12f7195ac72e3df7288
4
+ data.tar.gz: 68dc6a523edceecc6b15f45799cabd380927f24d934b6c876c2d7f0726c55241
5
5
  SHA512:
6
- metadata.gz: 95a20c76e4bee8e8517065af5f3d9325cf6773bcbb6f08f6a41e479ac41359927fe0c00aedd5dbd3fe43c1259d2cce44bd809c3b5aba913f7664844555101581
7
- data.tar.gz: 163ca9571024669fa96a6ccfca233b4f81e23e4fe1e4b80a69c837dfd618eda50b20b8a3fa50e3cb99d053cd287448b2156d58816bfd72a22c455fcd53a113d2
6
+ metadata.gz: fa5282763cef5946b344467cc0f8a568e7b364cc682b038bff2abcc0f807a5e86de4f454e76a70dd2c17e60c017a6a13d82e34099d0297b8b5c77c5ba41dd01f
7
+ data.tar.gz: cac6f6bf0d01b2266d3c3b41507a84274bfaa9f1f9bc2d1f8b2780a1bd7c3ac51f32b4dba98541b9e6f374010559afb9769f500ee8df9cf423c6cc7e3fecc014
data/lib/failbot.rb CHANGED
@@ -74,6 +74,15 @@ module Failbot
74
74
  # apps opt in to the newer version.
75
75
  self.exception_format = :haystack
76
76
 
77
+ # Helpers needed to parse hashes included in e.g. Failbot.reports.
78
+ def self.exception_message_from_hash(hash)
79
+ @exception_formatter.exception_message_from_hash(hash)
80
+ end
81
+
82
+ def self.exception_classname_from_hash(hash)
83
+ @exception_formatter.exception_classname_from_hash(hash)
84
+ end
85
+
77
86
  # Public: Setup the backend for reporting exceptions.
78
87
  def setup(settings={}, default_context={})
79
88
  deprecated_settings = %w[
@@ -20,6 +20,16 @@ module Failbot
20
20
  res
21
21
  end
22
22
 
23
+ # given a hash generated by this class, return the exception message.
24
+ def self.exception_message_from_hash(hash)
25
+ hash["message"]
26
+ end
27
+
28
+ # given a hash generated by this class, return the exception class name.
29
+ def self.exception_classname_from_hash(hash)
30
+ hash["class"]
31
+ end
32
+
23
33
  # We'll include this many nested Exception#cause objects in the needle
24
34
  # context. We limit the number of objects to prevent excessive recursion and
25
35
  # large needle contexts.
@@ -32,6 +32,16 @@ module Failbot
32
32
  }
33
33
  end
34
34
 
35
+ # given a hash generated by this class, return the exception message.
36
+ def self.exception_message_from_hash(hash)
37
+ hash.dig("exception_detail", 0, "value")
38
+ end
39
+
40
+ # given a hash generated by this class, return the exception class name.
41
+ def self.exception_classname_from_hash(hash)
42
+ hash.dig("exception_detail", 0, "type")
43
+ end
44
+
35
45
  def self.formatted_backtrace(e)
36
46
  if e.backtrace
37
47
  Backtrace.parse(e.backtrace).frames.reverse.map do |line|
@@ -1,3 +1,3 @@
1
1
  module Failbot
2
- VERSION = "2.4.0"
2
+ VERSION = "2.4.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: failbot
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.0
4
+ version: 2.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - "@rtomayko"
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2020-03-17 00:00:00.000000000 Z
13
+ date: 2020-03-18 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rake