exceptional 2.0.17 → 2.0.18

Sign up to get free protection for your applications and to get access to all the features.
data/init.rb CHANGED
@@ -15,16 +15,10 @@ if (defined?(Exceptional::VERSION::STRING) rescue nil) && %w(development test).i
15
15
  else
16
16
  begin
17
17
  Exceptional::Config.load(File.join(RAILS_ROOT, "/config/exceptional.yml"))
18
-
19
18
  Exceptional.logger.info("Loading Exceptional for #{Rails::VERSION::STRING}")
20
-
21
- if Rails::VERSION::STRING.to_i > 2
22
- puts "Exceptional Rails 3 Support via Rack"
23
- ::Rails.configuration.middleware.insert_after 'ActionDispatch::ShowExceptions', Rack::RailsExceptional
24
- else
25
- require File.join('exceptional', 'integration', 'rails')
26
- require File.join('exceptional', 'integration', 'dj')
27
- end
19
+
20
+ require File.join('exceptional', 'integration', 'rails')
21
+ require File.join('exceptional', 'integration', 'dj') if defined?(Delayed::Job)
28
22
  rescue => e
29
23
  STDERR.puts "Problem starting Exceptional Plugin. Your app will run as normal."
30
24
  Exceptional.logger.error(e.message)
@@ -14,6 +14,8 @@ require 'exceptional/integration/rack'
14
14
  require 'exceptional/integration/rack_rails'
15
15
  require 'exceptional/version'
16
16
 
17
+ require 'exceptional/railtie' if defined?(Rails::Railtie)
18
+
17
19
  module Exceptional
18
20
  PROTOCOL_VERSION = 5
19
21
  CLIENT_NAME = 'getexceptional-gem'
@@ -10,12 +10,17 @@ module Rack
10
10
 
11
11
  def call(env)
12
12
  begin
13
- status, headers, body = @app.call(env)
14
- rescue Exception => e
15
- puts ">>>#{env['action_controller.instance']}"
13
+ body = @app.call(env)
14
+ rescue Exception => e
16
15
  ::Exceptional::Catcher.handle_with_controller(e,env['action_controller.instance'], Rack::Request.new(env))
17
16
  raise
18
17
  end
19
- end
18
+
19
+ if env['rack.exception']
20
+ ::Exceptional::Catcher.handle_with_controller(env['rack.exception'],env['action_controller.instance'], Rack::Request.new(env))
21
+ end
22
+
23
+ body
24
+ end
20
25
  end
21
26
  end
@@ -0,0 +1,15 @@
1
+ require 'exceptional'
2
+ require 'rails'
3
+
4
+ module Exceptional
5
+ class Railtie < Rails::Railtie
6
+
7
+ initializer "exceptional.middleware" do |app|
8
+ Exceptional::Config.load(File.join(Rails.root, "/config/exceptional.yml"))
9
+ if Exceptional::Config.should_send_to_api?
10
+ Exceptional.logger.info("Loading Exceptional for #{Rails::VERSION::STRING}")
11
+ app.config.middleware.use Rack::RailsExceptional
12
+ end
13
+ end
14
+ end
15
+ end
@@ -14,7 +14,6 @@ module Exceptional
14
14
  end
15
15
 
16
16
  def error(exception_data)
17
- Exceptional.logger.info "Notifying Exceptional about an error"
18
17
  uniqueness_hash = exception_data.uniqueness_hash
19
18
  hash_param = uniqueness_hash.nil? ? nil: "&hash=#{uniqueness_hash}"
20
19
  url = "/api/errors?api_key=#{::Exceptional::Config.api_key}&protocol_version=#{::Exceptional::PROTOCOL_VERSION}#{hash_param}"
@@ -1,3 +1,3 @@
1
1
  module Exceptional
2
- VERSION = '2.0.17'
2
+ VERSION = '2.0.18'
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: exceptional
3
3
  version: !ruby/object:Gem::Version
4
- hash: 45
4
+ hash: 43
5
5
  prerelease: false
6
6
  segments:
7
7
  - 2
8
8
  - 0
9
- - 17
10
- version: 2.0.17
9
+ - 18
10
+ version: 2.0.18
11
11
  platform: ruby
12
12
  authors:
13
13
  - Contrast
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-07-27 00:00:00 +01:00
18
+ date: 2010-07-28 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies: []
21
21
 
@@ -42,6 +42,7 @@ files:
42
42
  - lib/exceptional/log_factory.rb
43
43
  - lib/exceptional/monkeypatches.rb
44
44
  - lib/exceptional/rack_exception_data.rb
45
+ - lib/exceptional/railtie.rb
45
46
  - lib/exceptional/remote.rb
46
47
  - lib/exceptional/startup.rb
47
48
  - lib/exceptional/version.rb