rack_bugzscout 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/rack_bugzscout.rb +10 -9
  2. metadata +1 -1
@@ -2,9 +2,7 @@ require 'rubygems'
2
2
  require 'bugzscout'
3
3
 
4
4
  module Rack
5
- # Catches all exceptions raised from the app it wraps and
6
- # sends a useful email with the exception, stacktrace, and
7
- # contents of the environment.
5
+ # Catches all exceptions raised, and submits them to FogBugz via BugzScout.
8
6
 
9
7
  class BugzScout
10
8
  attr_reader :fogbugz_url, :fogbugz_user, :fogbugz_project, :fogbugz_area
@@ -22,8 +20,6 @@ module Rack
22
20
  begin
23
21
  @app.call(env)
24
22
  rescue => boom
25
- # TODO don't allow exceptions from send_notification to
26
- # propogate
27
23
  send_notification boom, env
28
24
  raise
29
25
  end
@@ -33,16 +29,21 @@ module Rack
33
29
 
34
30
  private
35
31
  def send_notification(exception, env)
36
- puts "sending notification!!!!!"
37
- if %w(staging production).include?(ENV['RACK_ENV'])
38
- FogBugz::BugzScout.submit(@fogbugz_url) do |scout|
32
+ # wrapping this so we can avoid sending these up the chain
33
+ # not entirely sure that this is the right thing to do...
34
+ begin
35
+ if %w(staging production).include?(ENV['RACK_ENV'])
36
+ FogBugz::BugzScout.submit(@fogbugz_url) do |scout|
39
37
  scout.user = @fogbugz_user
40
38
  scout.project = @fogbugz_project
41
39
  scout.area = @fogbugz_area
42
40
  scout.title = exception.class.name
43
41
  scout.body = exception.message
44
42
  end
45
- env['bugzscout.submitted'] = true
43
+ env['bugzscout.submitted'] = true
44
+ end
45
+ rescue => error
46
+ # maybe we ought to log something here?
46
47
  end
47
48
  end
48
49
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack_bugzscout
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Gorsuch