exception_handling 1.0.4 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Rakefile +2 -1
- data/lib/exception_handling/version.rb +1 -1
- data/lib/exception_handling.rb +1 -7
- data/test/unit/exception_handling_test.rb +6 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ba22d4665ccfec321d2f12cd3dbf965aa470ce0f
|
4
|
+
data.tar.gz: 59d92855f4428b245ccafdab96ae2690a8df4be4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac10edb35d2d2e7ee25fe17aa7df89137452a368c5e95b599ed62a780c02bdf9e5cd9a0bbc334d7cb410dc8320ae8aaf3afbfc995ad489018a1b9e016c9b2a1c
|
7
|
+
data.tar.gz: 85c0eb7988d28e5fcbcb6f2e8e66f9a13b25dc8a174f4dff6ab6b414df4eb5dfbe3dfa2a01abaaf8a7e5f05d2416d4f1fc62024e4afc9d58f3340c4f771af94b
|
data/Rakefile
CHANGED
data/lib/exception_handling.rb
CHANGED
@@ -232,13 +232,7 @@ EOF
|
|
232
232
|
#
|
233
233
|
def write_exception_to_log(ex, exception_context, timestamp)
|
234
234
|
ActiveSupport::Deprecation.silence do
|
235
|
-
ExceptionHandling.logger.fatal(
|
236
|
-
if ActionView::TemplateError === ex
|
237
|
-
"#{ex} Error:#{timestamp}"
|
238
|
-
else
|
239
|
-
"\n(Error:#{timestamp}) #{ex.class} #{exception_context} (#{ex.message}):\n " + clean_backtrace(ex).join("\n ") + "\n\n"
|
240
|
-
end
|
241
|
-
)
|
235
|
+
ExceptionHandling.logger.fatal("\n(Error:#{timestamp}) #{ex.class} #{exception_context} (#{ex.message}):\n " + clean_backtrace(ex).join("\n ") + "\n\n")
|
242
236
|
end
|
243
237
|
end
|
244
238
|
|
@@ -107,10 +107,15 @@ class ExceptionHandlingTest < ActiveSupport::TestCase
|
|
107
107
|
end
|
108
108
|
|
109
109
|
context "ExceptionHandling.ensure_safe" do
|
110
|
-
should "log an exception if an exception is raised." do
|
110
|
+
should "log an exception with call stack if an exception is raised." do
|
111
111
|
mock(ExceptionHandling.logger).fatal(/\(blah\):\n.*exception_handling_test\.rb/)
|
112
112
|
ExceptionHandling.ensure_safe { raise ArgumentError.new("blah") }
|
113
113
|
end
|
114
|
+
|
115
|
+
should "log an exception with call stack if an ActionView template exception is raised." do
|
116
|
+
mock(ExceptionHandling.logger).fatal(/\(Error:\d+\) ActionView::Template::Error \(blah\):\n <no backtrace>/)
|
117
|
+
ExceptionHandling.ensure_safe { raise ActionView::TemplateError.new({}, {}, ArgumentError.new("blah")) }
|
118
|
+
end
|
114
119
|
|
115
120
|
should "should not log an exception if an exception is not raised." do
|
116
121
|
dont_allow(ExceptionHandling.logger).fatal
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: exception_handling
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Colin Kelley
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-11-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: eventmachine
|
@@ -216,3 +216,4 @@ test_files:
|
|
216
216
|
- test/unit/exception_handling/mailer_test.rb
|
217
217
|
- test/unit/exception_handling/methods_test.rb
|
218
218
|
- test/unit/exception_handling_test.rb
|
219
|
+
has_rdoc:
|