exceptiontrap 1.0.9 → 1.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +22 -1
- data/lib/exceptiontrap/config.rb +8 -1
- data/lib/exceptiontrap/notifier.rb +1 -1
- data/lib/exceptiontrap/version.rb +1 -1
- data/lib/exceptiontrap.rb +0 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1e1546e1ff9f694036ddc647154745b1295d5697
|
4
|
+
data.tar.gz: 0a53b01cc26040b3e553fc471f9dda767e8d6ecf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dbb996e48ea9db23d5798f42d967f0aa92ef336e8c1952bfc02fcce7768a22433148c26f0752c66bf3ac92bb702cf0fa626c7907aa37ecee6246e3fc2d3713fd
|
7
|
+
data.tar.gz: 8b6be5588a58b1517bfcf836b960e0ae321af2e95a79f594542ca7afcee1432862da2de4e72dbced12907beb2cc1871da955f748c2b428f7255e5390925b2556
|
data/README.md
CHANGED
@@ -69,7 +69,7 @@ Exceptiontrap catches [Sidekiq](http://sidekiq.org) errors automatically, you do
|
|
69
69
|
|
70
70
|
### DelayedJob
|
71
71
|
|
72
|
-
There is no automatic integration into [DelayedJob](https://github.com/collectiveidea/delayed_job) yet. Meanwhile you can let Exceptiontrap notifiy you about errors using its `notify` method inside
|
72
|
+
There is no automatic integration into [DelayedJob](https://github.com/collectiveidea/delayed_job) yet. Meanwhile you can let Exceptiontrap notifiy you about errors using its `notify` method inside DelayedJobs `error` hook.
|
73
73
|
|
74
74
|
```ruby
|
75
75
|
class ParanoidNewsletterJob < NewsletterJob
|
@@ -81,6 +81,27 @@ class ParanoidNewsletterJob < NewsletterJob
|
|
81
81
|
end
|
82
82
|
```
|
83
83
|
|
84
|
+
### Resque
|
85
|
+
|
86
|
+
automatic integration into [Resque](https://github.com/resque/resque) yet. Meanwhile you can let Exceptiontrap notifiy you about errors using its `notify` method inside Resques `on_failure` hook.
|
87
|
+
|
88
|
+
You can also create a module with Exceptiontrap enabled and integrate this.
|
89
|
+
|
90
|
+
```ruby
|
91
|
+
module ExceptiontrapJob
|
92
|
+
def on_failure(exception, *args)
|
93
|
+
Exceptiontrap.notify(exception, args)
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
class MyJob
|
98
|
+
extend ExceptiontrapJob
|
99
|
+
def self.perform(*args)
|
100
|
+
...
|
101
|
+
end
|
102
|
+
end
|
103
|
+
```
|
104
|
+
|
84
105
|
## Known Issues / Todo
|
85
106
|
|
86
107
|
Optimize and insert the test suite to the gem.
|
data/lib/exceptiontrap/config.rb
CHANGED
@@ -5,7 +5,9 @@ module Exceptiontrap
|
|
5
5
|
:enabled_environments => %w(production),
|
6
6
|
:ignored_exceptions => %w(ActiveRecord::RecordNotFound ActionController::RoutingError),
|
7
7
|
:filtered_params => %w(password s3-key),
|
8
|
-
:ssl => false
|
8
|
+
:ssl => false,
|
9
|
+
:notification_url => 'exceptiontrap.com/notifier/api/v1/problems',
|
10
|
+
:deployment_url => 'exceptiontrap.com/notifier/api/v1/deployments'
|
9
11
|
}
|
10
12
|
|
11
13
|
def load(config_file = nil)
|
@@ -18,6 +20,7 @@ module Exceptiontrap
|
|
18
20
|
@ignored_exceptions = config['ignoreExceptions']
|
19
21
|
@enabled_environments = config['enabledEnvironments']
|
20
22
|
@filtered_params = config['filterParams']
|
23
|
+
@notification_url = config['notificationUrl']
|
21
24
|
rescue Exception => e
|
22
25
|
raise "Unable to load configuration #{config_file} : #{e.message}"
|
23
26
|
end
|
@@ -28,6 +31,10 @@ module Exceptiontrap
|
|
28
31
|
@api_key
|
29
32
|
end
|
30
33
|
|
34
|
+
def notification_url
|
35
|
+
@notification_url ||= DEFAULTS[:notification_url]
|
36
|
+
end
|
37
|
+
|
31
38
|
def enabled_environments
|
32
39
|
@enabled_environments ||= DEFAULTS[:enabled_environments]
|
33
40
|
end
|
@@ -8,7 +8,7 @@ module Exceptiontrap
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def send_problem(serialized_data)
|
11
|
-
url = URI.parse((Config.use_ssl? ? 'https://' : 'http://') <<
|
11
|
+
url = URI.parse((Config.use_ssl? ? 'https://' : 'http://') << Config.notification_url)
|
12
12
|
client = prepare_client(url)
|
13
13
|
|
14
14
|
headers = HEADERS
|
data/lib/exceptiontrap.rb
CHANGED
@@ -16,8 +16,6 @@ require "exceptiontrap/sidekiq" if defined?(Sidekiq)
|
|
16
16
|
module Exceptiontrap
|
17
17
|
API_VERSION = '1'
|
18
18
|
NOTIFIER_NAME = 'exceptiontrap-rails'
|
19
|
-
NOTIFICATION_URL = 'exceptiontrap.com/notifier/api/v1/problems'
|
20
|
-
DEPLOYMENT_URL = 'exceptiontrap.com/notifier/api/v1/deployments'
|
21
19
|
|
22
20
|
HEADERS = {
|
23
21
|
'Content-type' => 'application/json',
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: exceptiontrap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- tbuehl
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-11-19 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Exception notifier. The Gem catches your applications exceptions and
|
14
14
|
sends those to the exceptiontrap webservice hosted at https://exceptiontrap.com
|