bugsnag 6.25.0 → 6.25.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -1
- data/VERSION +1 -1
- data/bugsnag.gemspec +9 -0
- data/lib/bugsnag/middleware/suggestion_data.rb +9 -7
- data/lib/bugsnag/report.rb +24 -2
- data/lib/bugsnag/stacktrace.rb +3 -1
- metadata +7 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3925f676929998c1f9738c6b7f82a174d3c87f13b5cc289da021c0d39160a0e5
|
4
|
+
data.tar.gz: 222b3cba78251ff98b80acab3c7129028714e714dbff8160a423e0b17e39db87
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: afb3ffe1e94f6a2ce20b22d16ab216f64a48c0f133618f6dc94ea5700e3e7f3a9554db70ebf98bf2db94acc884a8acb06d26c82996d3f8cce17ad164bb44a931
|
7
|
+
data.tar.gz: a988e117863633052de9bcbce5ca436823c106e075a2ef7f783afd33f74ca508392022fd2489e96f912d9815fd11137e572639855fb354edeb3c45b141018cc9
|
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,19 @@
|
|
1
1
|
Changelog
|
2
2
|
=========
|
3
3
|
|
4
|
-
## v6.
|
4
|
+
## v6.25.1 (5 January 2023)
|
5
|
+
|
6
|
+
### Fixes
|
7
|
+
|
8
|
+
* Allow Gem paths to be stripped from file names in stacktraces when they contain a Regexp special character
|
9
|
+
| [#764](https://github.com/bugsnag/bugsnag-ruby/pull/764)
|
10
|
+
|
11
|
+
### Enhancements
|
12
|
+
|
13
|
+
* Use `Exception#detailed_message` instead of `Exception#message` when available
|
14
|
+
| [#761](https://github.com/bugsnag/bugsnag-ruby/pull/761)
|
15
|
+
|
16
|
+
## v6.25.0 (1 December 2022)
|
5
17
|
|
6
18
|
### Enhancements
|
7
19
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
6.25.
|
1
|
+
6.25.1
|
data/bugsnag.gemspec
CHANGED
@@ -27,4 +27,13 @@ Gem::Specification.new do |s|
|
|
27
27
|
else
|
28
28
|
s.add_runtime_dependency 'concurrent-ruby', '~> 1.0'
|
29
29
|
end
|
30
|
+
|
31
|
+
if s.respond_to?(:metadata=)
|
32
|
+
s.metadata = {
|
33
|
+
"changelog_uri" => "https://github.com/bugsnag/bugsnag-ruby/blob/HEAD/CHANGELOG.md",
|
34
|
+
"documentation_uri" => "https://docs.bugsnag.com/platforms/ruby/",
|
35
|
+
"source_code_uri" => "https://github.com/bugsnag/bugsnag-ruby/",
|
36
|
+
"rubygems_mfa_required" => "true"
|
37
|
+
}
|
38
|
+
end
|
30
39
|
end
|
@@ -10,23 +10,25 @@ module Bugsnag::Middleware
|
|
10
10
|
@bugsnag = bugsnag
|
11
11
|
end
|
12
12
|
|
13
|
-
def call(
|
13
|
+
def call(event)
|
14
14
|
matches = []
|
15
|
-
|
16
|
-
|
15
|
+
|
16
|
+
event.errors.each do |error|
|
17
|
+
match = CAPTURE_REGEX.match(error.error_message)
|
18
|
+
|
17
19
|
next unless match
|
18
20
|
|
19
21
|
suggestions = match.captures[0].split(DELIMITER)
|
20
|
-
matches.concat
|
22
|
+
matches.concat(suggestions.map(&:strip))
|
21
23
|
end
|
22
24
|
|
23
25
|
if matches.size == 1
|
24
|
-
|
26
|
+
event.add_metadata(:error, { suggestion: matches.first })
|
25
27
|
elsif matches.size > 1
|
26
|
-
|
28
|
+
event.add_metadata(:error, { suggestions: matches })
|
27
29
|
end
|
28
30
|
|
29
|
-
@bugsnag.call(
|
31
|
+
@bugsnag.call(event)
|
30
32
|
end
|
31
33
|
end
|
32
34
|
end
|
data/lib/bugsnag/report.rb
CHANGED
@@ -428,9 +428,11 @@ module Bugsnag
|
|
428
428
|
|
429
429
|
def generate_exception_list
|
430
430
|
raw_exceptions.map do |exception|
|
431
|
+
class_name = error_class(exception)
|
432
|
+
|
431
433
|
{
|
432
|
-
errorClass:
|
433
|
-
message: exception
|
434
|
+
errorClass: class_name,
|
435
|
+
message: error_message(exception, class_name),
|
434
436
|
stacktrace: Stacktrace.process(exception.backtrace, configuration)
|
435
437
|
}
|
436
438
|
end
|
@@ -448,6 +450,26 @@ module Bugsnag
|
|
448
450
|
(exception.is_a? Class) ? exception.name : exception.class.name
|
449
451
|
end
|
450
452
|
|
453
|
+
def error_message(exception, class_name)
|
454
|
+
# Ruby 3.2 added Exception#detailed_message for Gems like "Did you mean"
|
455
|
+
# to annotate an exception's message
|
456
|
+
return exception.message unless exception.respond_to?(:detailed_message)
|
457
|
+
|
458
|
+
# the "highlight" argument may add terminal escape codes to the output,
|
459
|
+
# which we don't want to include
|
460
|
+
# it _should_ always be present but it's possible to forget to add it or
|
461
|
+
# to have implemented this method before Ruby 3.2
|
462
|
+
message =
|
463
|
+
begin
|
464
|
+
exception.detailed_message(highlight: false)
|
465
|
+
rescue ArgumentError
|
466
|
+
exception.detailed_message
|
467
|
+
end
|
468
|
+
|
469
|
+
# remove the class name to be consistent with Exception#message
|
470
|
+
message.sub(" (#{class_name})", '')
|
471
|
+
end
|
472
|
+
|
451
473
|
def generate_raw_exceptions(exception)
|
452
474
|
exceptions = []
|
453
475
|
|
data/lib/bugsnag/stacktrace.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bugsnag
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.25.
|
4
|
+
version: 6.25.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Smith
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-01-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|
@@ -106,7 +106,11 @@ files:
|
|
106
106
|
homepage: https://github.com/bugsnag/bugsnag-ruby
|
107
107
|
licenses:
|
108
108
|
- MIT
|
109
|
-
metadata:
|
109
|
+
metadata:
|
110
|
+
changelog_uri: https://github.com/bugsnag/bugsnag-ruby/blob/HEAD/CHANGELOG.md
|
111
|
+
documentation_uri: https://docs.bugsnag.com/platforms/ruby/
|
112
|
+
source_code_uri: https://github.com/bugsnag/bugsnag-ruby/
|
113
|
+
rubygems_mfa_required: 'true'
|
110
114
|
post_install_message:
|
111
115
|
rdoc_options: []
|
112
116
|
require_paths:
|