honeybadger 2.2.0 → 2.3.0

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
  SHA1:
3
- metadata.gz: 8160de0c185ac970e10e84e021b45b71dbf11a10
4
- data.tar.gz: 88bce8d5e8c501ca1ed7277d4a87741c389182af
3
+ metadata.gz: 29f055b7a43795a7fb1dc2bd177bc4cc1543f550
4
+ data.tar.gz: 0cb7571a9c2b042944a928b7ed5c4747d375fb4b
5
5
  SHA512:
6
- metadata.gz: 118a31afd13693527e72a2ad866db892d725ce47d84ac8d60cb4816a8070aa4bb2cb97115c47f2863e8f35412d5737aeafc618522d1a6d7ec51f817244c38968
7
- data.tar.gz: 94be0e16a5f7045f9bdaba4cc62a712d215e802f2eb09ae015725b9122b26ebbd4936a7f37a49d1abed48f011f1a113d27fe234a5fc9bd02f0983dc9f7f0d08a
6
+ metadata.gz: daf005336c8edb14c837bac5ade4fd5d0117a45e04a630252dcc396022e9cbbd13720cec420c0c2594789a0d20be6b161213174b2ec9e05909ec02be5d9a3bd3
7
+ data.tar.gz: 6455fdb12a7977e5bdacc793cb0a4a8005baa5f1fc8da3ff734d9de393b7e86e3fa5155f3937e33e164c1cc03319afd5511da1a30c40b3e323edb57ff3e8dc0c
@@ -3,11 +3,18 @@ All notable changes to this project will be documented in this file. See [Keep a
3
3
  CHANGELOG](http://keepachangelog.com/) for how to update this file. This project
4
4
  adheres to [Semantic Versioning](http://semver.org/).
5
5
 
6
- ## [Unreleased][unreleased]
6
+ ## [2.3.0] - 2015-11-12
7
+
8
+ ### Added
9
+ - Rails 5 support.
10
+ - Support overriding TTY behavior in rake reporter.
11
+
12
+ ## Fixed
13
+ - Capistrano 3 `undefined method `verbosity'` bugfix.
14
+ - Fixed "uninitialized constant Set" error when Set is not previously required.
7
15
 
8
16
  ## [2.2.0] - 2015-10-29
9
17
  ## Added
10
-
11
18
  - Added a config option to automatically set the component to the class name of the
12
19
  Sidekiq job where an error originated. Causes errors to be grouped by worker
13
20
  in addition to class name/location.
data/README.md CHANGED
@@ -263,7 +263,13 @@ You can use any of the options below in your config file, or in the environment.
263
263
  |__TRACE REPORTING__ | ||
264
264
  |`traces.enabled` | Boolean | Enable sending performance traces for slow actions.<br/>_Default: `true`_|
265
265
  |`traces.threshold` | Integer | The threshold in seconds to send traces.<br/>_Default: `2000`_|
266
-
266
+ |__SIDEKIQ__ | ||
267
+ |`sidekiq.attempt_threshold` | Integer | The number of attempts before notifications will be sent.<br/>_Default: `0`_|
268
+ |`sidekiq.use_component` | Boolean | Automatically set the component to the class of the job. Helps with grouping.<br/>_Default: `false`_|
269
+ |__DELAYED JOB__ | ||
270
+ |`delayed_job.attempt_threshold` | Integer | The number of attempts before notifications will be sent.<br/>_Default: `0`_|
271
+ |__SINATRA__ | ||
272
+ |`sinatra.enabled` | Boolean | Enable Sinatra auto-initialization.<br/>_Default: `true`_|
267
273
 
268
274
  ## Public Methods
269
275
 
@@ -114,7 +114,11 @@ module Honeybadger
114
114
  eval(<<-CONTROLLER)
115
115
  class Honeybadger::TestController < ApplicationController
116
116
  # This is to bypass any filters that may prevent access to the action.
117
- prepend_before_filter :test_honeybadger
117
+ if respond_to?(:prepend_before_action)
118
+ prepend_before_action :test_honeybadger
119
+ else
120
+ prepend_before_filter :test_honeybadger
121
+ end
118
122
 
119
123
  def test_honeybadger
120
124
  puts "Raising '#{test_exception_class.name}' to simulate application failure."
@@ -223,7 +223,7 @@ module Honeybadger
223
223
  },
224
224
  :'exceptions.rescue_rake' => {
225
225
  description: 'Enable rescuing exceptions in rake tasks.',
226
- default: true,
226
+ default: !STDOUT.tty?,
227
227
  type: Boolean
228
228
  },
229
229
  :'exceptions.source_radius' => {
@@ -1,7 +1,11 @@
1
1
  require 'rails'
2
2
  require 'yaml'
3
+
3
4
  require 'honeybadger/util/sanitizer'
4
5
  require 'honeybadger/util/request_payload'
6
+ require 'honeybadger/rack/error_notifier'
7
+ require 'honeybadger/rack/user_informer'
8
+ require 'honeybadger/rack/user_feedback'
5
9
 
6
10
  module Honeybadger
7
11
  module Init
@@ -16,9 +20,9 @@ module Honeybadger
16
20
  if Honeybadger.start(config)
17
21
  if config.feature?(:notices) && config[:'exceptions.enabled']
18
22
  ::Rails.application.config.middleware.tap do |middleware|
19
- middleware.insert(0, 'Honeybadger::Rack::ErrorNotifier', config)
20
- middleware.insert_before('Honeybadger::Rack::ErrorNotifier', 'Honeybadger::Rack::UserInformer', config) if config[:'user_informer.enabled']
21
- middleware.insert_before('Honeybadger::Rack::ErrorNotifier', 'Honeybadger::Rack::UserFeedback', config) if config[:'feedback.enabled']
23
+ middleware.insert(0, Honeybadger::Rack::ErrorNotifier, config)
24
+ middleware.insert_before(Honeybadger::Rack::ErrorNotifier, Honeybadger::Rack::UserInformer, config) if config[:'user_informer.enabled']
25
+ middleware.insert_before(Honeybadger::Rack::ErrorNotifier, Honeybadger::Rack::UserFeedback, config) if config[:'feedback.enabled']
22
26
  end
23
27
  end
24
28
 
@@ -10,12 +10,10 @@ module Honeybadger
10
10
  end
11
11
 
12
12
  def display_error_message_with_honeybadger(ex)
13
- if !self.tty_output?
14
- Honeybadger.notify_or_ignore(ex, origin: :rake, component: reconstruct_command_line)
15
- Honeybadger.context.clear!
16
- end
17
-
13
+ Honeybadger.notify(ex, origin: :rake, component: reconstruct_command_line)
18
14
  display_error_message_without_honeybadger(ex)
15
+ ensure
16
+ Honeybadger.context.clear!
19
17
  end
20
18
 
21
19
  def reconstruct_command_line
@@ -227,7 +227,9 @@ module Honeybadger
227
227
  attr_reader :config, :opts, :context, :stats, :now, :pid, :causes, :sanitizer, :request_sanitizer
228
228
 
229
229
  def ignore_by_origin?
230
- opts[:origin] == :rake && !config[:'exceptions.rescue_rake']
230
+ return false if opts[:origin] != :rake
231
+ return false if config[:'exceptions.rescue_rake']
232
+ true
231
233
  end
232
234
 
233
235
  def ignore_by_callbacks?
@@ -9,10 +9,28 @@ module Honeybadger
9
9
  base.send(:alias_method, :render_exception, :render_exception_with_honeybadger)
10
10
  end
11
11
 
12
- def render_exception_with_honeybadger(env, exception)
12
+ # Internal: Adds additional Honeybadger info to Request env when an
13
+ # exception is rendered in Rails' middleware.
14
+ #
15
+ # arg - The Rack env Hash in Rails 3.0-4.2. After Rails 5 arg is
16
+ # an ActionDispatch::Request.
17
+ # exception - The Exception which was rescued.
18
+ #
19
+ # Returns the super value of the middleware's #render_exception()
20
+ # method.
21
+ def render_exception_with_honeybadger(arg, exception)
22
+ if arg.kind_of?(::ActionDispatch::Request)
23
+ request = arg
24
+ env = request.env
25
+ else
26
+ request = ::Rack::Request.new(arg)
27
+ env = arg
28
+ end
29
+
13
30
  env['honeybadger.exception'] = exception
14
- env['honeybadger.request.url'] = ::Rack::Request.new(env).url rescue nil
15
- render_exception_without_honeybadger(env,exception)
31
+ env['honeybadger.request.url'] = request.url rescue nil
32
+
33
+ render_exception_without_honeybadger(arg, exception)
16
34
  end
17
35
  end
18
36
 
@@ -1,3 +1,5 @@
1
+ require 'set'
2
+
1
3
  module Honeybadger
2
4
  module Util
3
5
  class Sanitizer
@@ -76,7 +78,7 @@ module Honeybadger
76
78
  filtered_url = url.to_s.dup
77
79
  filtered_url.scan(/(?:^|&|\?)([^=?&]+)=([^&]+)/).each do |m|
78
80
  next unless filter_key?(m[0])
79
- filtered_url.gsub!(/#{m[1]}/, FILTERED_REPLACEMENT)
81
+ filtered_url.gsub!(/#{Regexp.escape(m[1])}/, FILTERED_REPLACEMENT)
80
82
  end
81
83
 
82
84
  filtered_url
@@ -1,4 +1,4 @@
1
1
  module Honeybadger
2
2
  # Public: The current String Honeybadger version.
3
- VERSION = '2.2.0'.freeze
3
+ VERSION = '2.3.0'.freeze
4
4
  end
@@ -7,14 +7,14 @@ namespace :honeybadger do
7
7
  task :deploy => :env do
8
8
  next if sshkit_outdated?
9
9
  if server = fetch(:honeybadger_server)
10
+ invoke "#{scm}:set_current_revision"
11
+ revision = fetch(:current_revision)
12
+
10
13
  on server do |host|
11
14
  info 'Notifying Honeybadger of deploy.'
12
15
 
13
16
  executable = fetch(:honeybadger, :honeybadger)
14
17
 
15
- invoke "#{scm}:set_current_revision"
16
- revision = fetch(:current_revision)
17
-
18
18
  options = [
19
19
  'deploy',
20
20
  '--environment', fetch(:honeybadger_env, fetch(:rails_env, 'production')),
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: honeybadger
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Honeybadger Industries LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-29 00:00:00.000000000 Z
11
+ date: 2015-11-12 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Make managing application errors a more pleasant experience.
14
14
  email: