console 1.23.0 → 1.23.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/console/format/safe.rb +19 -1
- data/lib/console/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f053978f1ebc28b2973844d0ef018eeb200651ffb9bf00702a09ca3b04614fce
|
4
|
+
data.tar.gz: 4f8177c79c3e0d4f9b43e0e4b2c3f02e72837ca7d31e76a6eff308b41848e064
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 01bed9d6648e51ca76c7af4944f640eff416510bd7160ce9e9fd54c6c6397a213b45cfe8b4628d0e2071716b2651362e187f119d82053b85a7c4e5bb06d66fed
|
7
|
+
data.tar.gz: 80de59979995f867f791052666b20d5d1f50ed01a74af4529797b604934b3f18e064f113963b55014c5f90497b40be82ba124443036f8cb34414b48e6c6bc50b
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/console/format/safe.rb
CHANGED
@@ -18,7 +18,7 @@ module Console
|
|
18
18
|
|
19
19
|
def dump(object)
|
20
20
|
@format.dump(object, @limit)
|
21
|
-
rescue => error
|
21
|
+
rescue SystemStackError, StandardError => error
|
22
22
|
@format.dump(safe_dump(object, error))
|
23
23
|
end
|
24
24
|
|
@@ -28,6 +28,23 @@ module Console
|
|
28
28
|
Hash.new.compare_by_identity
|
29
29
|
end
|
30
30
|
|
31
|
+
# The first N frames, noting that the last frame is a placeholder for all the skipped frames:
|
32
|
+
FIRST_N_FRAMES = 10 + 1
|
33
|
+
LAST_N_FRAMES = 20
|
34
|
+
MAXIMUM_FRAMES = FIRST_N_FRAMES + LAST_N_FRAMES
|
35
|
+
|
36
|
+
def filter_backtrace(error)
|
37
|
+
frames = error.backtrace
|
38
|
+
|
39
|
+
# Select only the first and last few frames:
|
40
|
+
if frames.size > MAXIMUM_FRAMES
|
41
|
+
frames[FIRST_N_FRAMES-1] = "[... #{frames.size - (MAXIMUM_FRAMES-1)} frames ...]"
|
42
|
+
frames.slice!(FIRST_N_FRAMES...-LAST_N_FRAMES)
|
43
|
+
end
|
44
|
+
|
45
|
+
return frames
|
46
|
+
end
|
47
|
+
|
31
48
|
def safe_dump(object, error)
|
32
49
|
object = safe_dump_recurse(object)
|
33
50
|
|
@@ -35,6 +52,7 @@ module Console
|
|
35
52
|
object[:error] = {
|
36
53
|
class: safe_dump_recurse(error.class.name),
|
37
54
|
message: safe_dump_recurse(error.message),
|
55
|
+
backtrace: safe_dump_recurse(filter_backtrace(error)),
|
38
56
|
}
|
39
57
|
|
40
58
|
return object
|
data/lib/console/version.rb
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|