periskop-client 0.1.0 → 0.1.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: 0d35f32e41d59a38412f7c5a424fe1586c836313c48af76ffa2aadbddd36b15b
4
- data.tar.gz: 6a03127bfa7a1f521d2719557330c8dc9c4d2d4f11f24c8da612ce2249e16302
3
+ metadata.gz: 4a60b0627c1e4075aa616aa857ddeaca798d24e76236db830d50cf429125bb28
4
+ data.tar.gz: 93edd00a43ddc36ce6f381aee402269f782c9257c2e011f372b2e87cd0bca543
5
5
  SHA512:
6
- metadata.gz: 1e7fdfa8becf464beba2e157dc5baf55d7a71f23f628b64e43d7f39ec830a67e497fe02bddaff931b37b56279abcbf20fd6144827286a1d1b734ce7b2f6172fb
7
- data.tar.gz: 4c50cdae5ac0f5c619567074ef53470157b730c6005799c365a47decb99ec740beee943a10bad70fcbf322db9e7d293082b1455723802ccd374028d89e8b6ce7
6
+ metadata.gz: fd7e92bbb19014280b788324018d40e5082531edce8e775ebfa6ab9925d190febcba8b9bdf95e66acdd6f0f69f9dbcb618343c268d34a8497ea7c29b75f47eb6
7
+ data.tar.gz: 0b8d4941b6f6740f33541935557f752fb0b13f49d1e919d0454ddf14b70fd5c336e5defdc14cc68988209e71a6f2d24e1c552a164bafc92ee18577569c68f6cb
@@ -35,12 +35,7 @@ module Periskop
35
35
  private
36
36
 
37
37
  def add_exception(exception, context)
38
- exception_instance = ExceptionInstance.new(
39
- exception.class.name,
40
- exception.message,
41
- exception.backtrace,
42
- get_cause(exception)
43
- )
38
+ exception_instance = ExceptionInstance.from_exception(exception)
44
39
  exception_with_context = ExceptionWithContext.new(
45
40
  exception_instance,
46
41
  context,
@@ -58,14 +53,6 @@ module Periskop
58
53
  aggregated_exception = @aggregated_exceptions_dict[aggregation_key]
59
54
  aggregated_exception.add_exception(exception_with_context)
60
55
  end
61
-
62
- def get_cause(exception)
63
- if RUBY_VERSION > '2.0'
64
- return exception.cause
65
- end
66
-
67
- nil
68
- end
69
56
  end
70
57
  end
71
58
  end
@@ -18,6 +18,25 @@ module Periskop
18
18
  @cause = cause
19
19
  end
20
20
 
21
+ def self.from_exception(exception)
22
+ ExceptionInstance.new(
23
+ exception.class.name,
24
+ exception.message,
25
+ exception.backtrace,
26
+ get_cause(exception)
27
+ )
28
+ end
29
+
30
+ def self.get_cause(exception)
31
+ if RUBY_VERSION > '2.0'
32
+ if exception.cause.is_a?(Exception)
33
+ return ExceptionInstance.from_exception(exception.cause)
34
+ end
35
+ end
36
+
37
+ nil
38
+ end
39
+
21
40
  def as_json(_options = {})
22
41
  {
23
42
  class: @class,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: periskop-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julio Zynger
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-01-14 00:00:00.000000000 Z
12
+ date: 2022-02-04 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Periskop client for Ruby
15
15
  email: