denouncer 0.2.12 → 0.2.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 07b022374e9e3b5e1f7a9853e27f51f472cb6af8
4
- data.tar.gz: 1c985fe1dc8a471df1d4b09a24ea51a1fda48775
3
+ metadata.gz: 2f7c1f9cc8a7072f8f71b80eb1f6fea02e74d20c
4
+ data.tar.gz: 465051f928dd370df5fffa886b677fe1e686205c
5
5
  SHA512:
6
- metadata.gz: 58a9fe870c1421a11ef3c07b2425a052f765b9261718b74ee578522b16a45dcbd8b82b55f748e00586bf43dd315545ea08753a63d448deca5aef768470319074
7
- data.tar.gz: 3be86aac355a2f90ab061e9d06dafb71036924f7a1edf4206dd7854dcfffd7adbe43f34a2eb04076fd4524c775e7b0e6fa63ba4ae300d4971744f45dba970720
6
+ metadata.gz: 15664ad3f6338b88a7209c81bfdaa837e5993e9c28243c32caf8b8021818b1c5f45770d2f10c928fda8d64968648d864f537be3f579e2d4d1165a7b0e4f1efd6
7
+ data.tar.gz: 241110fb60a733e221d5d49d7191530b64dd214c5b8a635b94c26676f4f5d90227c90597fadc01704fa107dd32cfcf01f0fc37e852b4803180dc8fe7a1c3e357
@@ -45,7 +45,7 @@ module Denouncer
45
45
  error_class: error.class.name,
46
46
  error_backtrace: error.backtrace,
47
47
  error_message: error.message,
48
- error_cause: error.cause,
48
+ error_cause: get_error_cause(error),
49
49
  metadata: metadata
50
50
  }
51
51
  end
@@ -18,6 +18,15 @@ module Denouncer
18
18
  Time.now.utc
19
19
  end
20
20
 
21
+ # returns the given error's cause if available
22
+ def get_error_cause(error)
23
+ if error.respond_to? :cause
24
+ error.cause
25
+ else
26
+ nil
27
+ end
28
+ end
29
+
21
30
  def set_configuration!(options)
22
31
  raise NotImplementedException("This method needs to be implemented in a sub-class!")
23
32
  end
@@ -63,7 +63,7 @@ Backtrace:
63
63
  #{formatted_backtrace(error)}
64
64
 
65
65
  Error cause:
66
- #{error.cause}
66
+ #{get_error_cause(error)}
67
67
 
68
68
  Metadata:
69
69
  #{metadata.to_s}
@@ -1,3 +1,3 @@
1
1
  module Denouncer
2
- VERSION = "0.2.12"
2
+ VERSION = "0.2.13"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: denouncer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.12
4
+ version: 0.2.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julian Weber