bugsnag 6.17.0 → 6.18.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/VERSION +1 -1
- data/lib/bugsnag.rb +36 -2
- data/lib/bugsnag/breadcrumbs/breadcrumb.rb +1 -1
- data/lib/bugsnag/delivery/synchronous.rb +1 -1
- data/lib/bugsnag/helpers.rb +2 -2
- data/lib/bugsnag/report.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 29a2a991d8e578989dee9cd0d83e348641c8985c2ac59de3840abe7dbe2691da
|
4
|
+
data.tar.gz: a75ca7b1949633520ced32c604299f9f625f980d7d2efaabf253529d1e2acae6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a0dacb630c81e3a867df883040c3f6d16174706be29d56974b759850a9c19e6518e2fdb793365007b9d0caaecf2d8c18cc937e8df82d86fa8796fe5a08940bd2
|
7
|
+
data.tar.gz: 53d5f08ac9f375bfea5c629f0a1cf0b83684e4ae865058fdf2dd7939d9d36a888b1b87cb33af9fe04ce32e0daaca140a354c9eb4a5b3fa725a626348a47ef117
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,16 @@
|
|
1
1
|
Changelog
|
2
2
|
=========
|
3
3
|
|
4
|
+
## 6.18.0 (27 October 2020)
|
5
|
+
|
6
|
+
### Enhancements
|
7
|
+
|
8
|
+
* Bugsnag should now report uncaught exceptions inside Bundler's 'friendly errors'
|
9
|
+
| [#634](https://github.com/bugsnag/bugsnag-ruby/pull/634)
|
10
|
+
|
11
|
+
* Improve the display of breadrumbs in the Bugsnag app by including milliseconds in timestamps
|
12
|
+
| [#639](https://github.com/bugsnag/bugsnag-ruby/pull/639)
|
13
|
+
|
4
14
|
## 6.17.0 (27 August 2020)
|
5
15
|
|
6
16
|
### Enhancements
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
6.
|
1
|
+
6.18.0
|
data/lib/bugsnag.rb
CHANGED
@@ -25,7 +25,6 @@ require "bugsnag/middleware/rails3_request"
|
|
25
25
|
require "bugsnag/middleware/sidekiq"
|
26
26
|
require "bugsnag/middleware/mailman"
|
27
27
|
require "bugsnag/middleware/rake"
|
28
|
-
require "bugsnag/middleware/callbacks"
|
29
28
|
require "bugsnag/middleware/classify_error"
|
30
29
|
require "bugsnag/middleware/delayed_job"
|
31
30
|
|
@@ -136,7 +135,9 @@ module Bugsnag
|
|
136
135
|
@exit_handler_added = true
|
137
136
|
at_exit do
|
138
137
|
if $!
|
139
|
-
|
138
|
+
exception = unwrap_bundler_exception($!)
|
139
|
+
|
140
|
+
Bugsnag.notify(exception, true) do |report|
|
140
141
|
report.severity = 'error'
|
141
142
|
report.severity_reason = {
|
142
143
|
:type => Bugsnag::Report::UNHANDLED_EXCEPTION
|
@@ -390,6 +391,39 @@ module Bugsnag
|
|
390
391
|
|
391
392
|
::JSON.dump(trimmed)
|
392
393
|
end
|
394
|
+
|
395
|
+
##
|
396
|
+
# When running a script with 'bundle exec', uncaught exceptions will be
|
397
|
+
# converted to "friendly errors" which has the side effect of wrapping them
|
398
|
+
# in a SystemExit
|
399
|
+
#
|
400
|
+
# By default we ignore SystemExit, so need to unwrap the original exception
|
401
|
+
# in order to avoid ignoring real errors
|
402
|
+
#
|
403
|
+
# @param exception [Exception]
|
404
|
+
# @return [Exception]
|
405
|
+
def unwrap_bundler_exception(exception)
|
406
|
+
running_in_bundler = ENV.include?('BUNDLE_BIN_PATH')
|
407
|
+
|
408
|
+
# See if this exception came from Bundler's 'with_friendly_errors' method
|
409
|
+
return exception unless running_in_bundler
|
410
|
+
return exception unless exception.is_a?(SystemExit)
|
411
|
+
return exception unless exception.respond_to?(:cause)
|
412
|
+
return exception unless exception.backtrace.first.include?('/bundler/friendly_errors.rb')
|
413
|
+
return exception if exception.cause.nil?
|
414
|
+
|
415
|
+
unwrapped = exception.cause
|
416
|
+
|
417
|
+
# We may need to unwrap another level if the exception came from running
|
418
|
+
# an executable file directly (i.e. 'bundle exec <file>'). In this case
|
419
|
+
# there can be a SystemExit from 'with_friendly_errors' _and_ a SystemExit
|
420
|
+
# from 'kernel_load'
|
421
|
+
return unwrapped unless unwrapped.is_a?(SystemExit)
|
422
|
+
return unwrapped unless unwrapped.backtrace.first.include?('/bundler/cli/exec.rb')
|
423
|
+
return unwrapped if unwrapped.cause.nil?
|
424
|
+
|
425
|
+
unwrapped.cause
|
426
|
+
end
|
393
427
|
end
|
394
428
|
end
|
395
429
|
# rubocop:enable Metrics/ModuleLength
|
data/lib/bugsnag/helpers.rb
CHANGED
@@ -94,11 +94,11 @@ module Bugsnag
|
|
94
94
|
|
95
95
|
##
|
96
96
|
# Wrapper for trimming stacktraces
|
97
|
-
def self.extract_exception(payload)
|
97
|
+
def self.extract_exception(payload, &block)
|
98
98
|
valid_payload = payload.is_a?(Hash) && payload[:events].respond_to?(:map)
|
99
99
|
return unless valid_payload && block_given?
|
100
100
|
payload[:events].each do |event|
|
101
|
-
event[:exceptions].each
|
101
|
+
event[:exceptions].each(&block)
|
102
102
|
end
|
103
103
|
end
|
104
104
|
|
data/lib/bugsnag/report.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.
|
4
|
+
version: 6.18.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Smith
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-10-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|