rollbar 0.9.0 → 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Change Log
2
2
 
3
+ **0.9.1**
4
+ - Add support to play nicely with Better Errors.
5
+
3
6
  **0.9.0**
4
7
  - Behavior change: start configuration as `@enabled = false`, and set to true when `configure` is called. This addresses an issue using Rollbar without the environment initialized. Such reports would always fail (since there would be no access token), but now they won't be attempted.
5
8
 
@@ -0,0 +1,37 @@
1
+ require 'better_errors'
2
+
3
+ module BetterErrors
4
+ class Middleware
5
+ alias_method :orig_show_error_page, :show_error_page
6
+
7
+ private
8
+
9
+ def show_error_page(env)
10
+ exception = @error_page.exception
11
+
12
+ exception_data = nil
13
+ begin
14
+ controller = env['action_controller.instance']
15
+ request_data = controller.try(:rollbar_request_data)
16
+ person_data = controller.try(:rollbar_person_data)
17
+ exception_data = Rollbar.report_exception(exception, request_data, person_data)
18
+ rescue => e
19
+ # TODO use logger here?
20
+ puts "[Rollbar] Exception while reporting exception to Rollbar: #{e}"
21
+ end
22
+
23
+ # if an exception was reported, save uuid in the env
24
+ # so it can be displayed to the user on the error page
25
+ if exception_data
26
+ begin
27
+ env['rollbar.exception_uuid'] = exception_data[:uuid]
28
+ rescue => e
29
+ puts "[Rollbar] Exception saving uuid in env: #{e}"
30
+ end
31
+ end
32
+
33
+ # now continue as normal
34
+ orig_show_error_page(env)
35
+ end
36
+ end
37
+ end
@@ -1,3 +1,3 @@
1
1
  module Rollbar
2
- VERSION = "0.9.0"
2
+ VERSION = "0.9.1"
3
3
  end
data/lib/rollbar.rb CHANGED
@@ -17,6 +17,7 @@ require 'rollbar/goalie' if defined?(Goalie)
17
17
  require 'rollbar/rack' if defined?(Rack)
18
18
  require 'rollbar/rake' if defined?(Rake)
19
19
  require 'rollbar/railtie' if defined?(Rails)
20
+ require 'rollbar/better_errors' if defined?(BetterErrors)
20
21
 
21
22
  module Rollbar
22
23
  class << self
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rollbar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-01 00:00:00.000000000 Z
12
+ date: 2013-03-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: multi_json
@@ -126,6 +126,7 @@ files:
126
126
  - lib/generators/rollbar/rollbar_generator.rb
127
127
  - lib/generators/rollbar/templates/initializer.rb
128
128
  - lib/rollbar.rb
129
+ - lib/rollbar/better_errors.rb
129
130
  - lib/rollbar/configuration.rb
130
131
  - lib/rollbar/delayed_job.rb
131
132
  - lib/rollbar/exception_reporter.rb
@@ -280,3 +281,4 @@ test_files:
280
281
  - spec/rollbar_spec.rb
281
282
  - spec/spec_helper.rb
282
283
  - spec/support/devise.rb
284
+ has_rdoc: