Lipsiasoft-exception-notifier 1.0 → 1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/generators/exception_notifier/templates/views/404.html.erb +1 -1
- data/generators/exception_notifier/templates/views/404.html.haml +2 -2
- data/generators/exception_notifier/templates/views/422.html.erb +2 -2
- data/generators/exception_notifier/templates/views/422.html.haml +1 -1
- data/generators/exception_notifier/templates/views/500.html.erb +1 -1
- data/generators/exception_notifier/templates/views/500.html.haml +1 -1
- data/lib/controller/rescue.rb +8 -3
- metadata +1 -1
data/Rakefile
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
<div class="exception">
|
2
|
-
<h1>We're sorry, but something went wrong
|
2
|
+
<h1>We're sorry, but something went wrong</h1>
|
3
3
|
<p>We've been notified about this issue and we'll take a look at it shortly.</p>
|
4
4
|
<p><small>(If you're the administrator of this website, then please read
|
5
5
|
the log file "<%=h RAILS_ENV %>.log"
|
data/lib/controller/rescue.rb
CHANGED
@@ -25,14 +25,19 @@ module Lipsiadmin
|
|
25
25
|
def rescue_action_in_public_with_notifier(exception) #:doc:
|
26
26
|
response_code = response_code_for_rescue(exception)
|
27
27
|
status = interpret_status(response_code)[0,3]
|
28
|
-
|
29
|
-
|
30
|
-
|
28
|
+
respond_to do |format|
|
29
|
+
format.html { render :template => "/exceptions/#{status}", :status => status }
|
30
|
+
format.all { render :nothing => true, :status => true }
|
31
|
+
#format.js { render(:update) { |page| page.call "alert", interpret_status(response_code) } }
|
31
32
|
end
|
32
33
|
rescue Exception => e
|
33
34
|
logger.error e.message
|
34
35
|
erase_results
|
35
36
|
rescue_action_in_public_without_notifier(exception)
|
37
|
+
ensure
|
38
|
+
if response_code != :not_found
|
39
|
+
Lipsiadmin::Mailer::ExceptionNotifier.deliver_exception(exception, self, request)
|
40
|
+
end
|
36
41
|
end
|
37
42
|
|
38
43
|
end
|