dreamcatcher 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
@@ -1,9 +1,13 @@
|
|
1
1
|
class Dreamcatcher::ExceptionContext
|
2
2
|
|
3
|
-
attr_reader :exception, :log_entries, :
|
3
|
+
attr_reader :exception, :log_entries, :context, :timestamp
|
4
4
|
|
5
|
-
def initialize(exception, log_entries,
|
6
|
-
@exception, @log_entries, @
|
5
|
+
def initialize(exception, log_entries, context = {})
|
6
|
+
@exception, @log_entries, @context = exception, log_entries, context
|
7
7
|
@timestamp = Time.now
|
8
8
|
end
|
9
|
+
|
10
|
+
def [](key)
|
11
|
+
@context[key]
|
12
|
+
end
|
9
13
|
end
|
data/lib/dreamcatcher/monitor.rb
CHANGED
@@ -13,7 +13,7 @@ class Dreamcatcher::Monitor
|
|
13
13
|
logger_proxy.capture { block.call }
|
14
14
|
|
15
15
|
rescue @configuration.exception_class => exception
|
16
|
-
context = Dreamcatcher::ExceptionContext.new(exception, logger_proxy.log_entries)
|
16
|
+
context = Dreamcatcher::ExceptionContext.new(exception, logger_proxy.log_entries, @context)
|
17
17
|
handlers.each { |handler| handler.handle_exception(context) }
|
18
18
|
raise
|
19
19
|
end
|
@@ -20,10 +20,8 @@
|
|
20
20
|
|
21
21
|
<% if exception.backtrace %>
|
22
22
|
<h3> Backtrace </h3>
|
23
|
-
<pre style="font-family:monospace;">
|
24
|
-
|
25
|
-
<%= line %>
|
26
|
-
<% end %>
|
23
|
+
<pre style="font-family:monospace; overflow-x: visible;">
|
24
|
+
<%= exception.backtrace.join("\n") %>
|
27
25
|
</pre>
|
28
26
|
<% end %>
|
29
27
|
|
@@ -32,7 +30,7 @@
|
|
32
30
|
<h3> Log </h3>
|
33
31
|
<pre style="font-family:monospace;">
|
34
32
|
<% log_entries.each do |entry| %>
|
35
|
-
<%= entry.to_s %>
|
33
|
+
<%= entry.to_s %>
|
36
34
|
<% end %>
|
37
35
|
</pre>
|
38
36
|
<% end %>
|
data/lib/dreamcatcher/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dreamcatcher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-03-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: pony
|
16
|
-
requirement:
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,7 +21,12 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
25
30
|
description: Catch exceptions and send email notifications with context.
|
26
31
|
email:
|
27
32
|
- willem@railsdoctors.com
|
@@ -69,7 +74,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
69
74
|
version: '0'
|
70
75
|
requirements: []
|
71
76
|
rubyforge_project:
|
72
|
-
rubygems_version: 1.8.
|
77
|
+
rubygems_version: 1.8.25
|
73
78
|
signing_key:
|
74
79
|
specification_version: 3
|
75
80
|
summary: Catch exceptions and send email notifications with context.
|