Lipsiasoft-exception-notifier 1.0 → 1.1

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.
data/Rakefile CHANGED
@@ -4,7 +4,7 @@ require 'rake/rdoctask'
4
4
  require 'rake/gempackagetask'
5
5
 
6
6
  PKG_NAME = 'exception-notifier'
7
- PKG_VERSION = "1.0"
7
+ PKG_VERSION = "1.1"
8
8
  PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
9
9
 
10
10
  $LOAD_PATH << File.join(File.dirname(__FILE__), 'lib')
@@ -1,4 +1,4 @@
1
1
  <div class="exception">
2
- <h1>The page you were looking for doesn't exist.</h1>
2
+ <h1>The page you were looking for doesn't exist</h1>
3
3
  <p>You may have mistyped the address or the page may have moved.</p>
4
4
  </div>
@@ -1,5 +1,5 @@
1
1
  .exception
2
- %h1 The page you were looking for doesn't exist.
3
- %p You may have mistyped the address or the page may have moved.
2
+ %h1 The page you were looking for doesn't exist
3
+ %p You may have mistyped the address or the page may have moved.
4
4
 
5
5
 
@@ -1,4 +1,4 @@
1
1
  <div class="exception">
2
- <h1>The change you wanted was rejected.</h1>
3
- <p>Maybe you tried to change something you didn't have access to.</p>
2
+ <h1>The change you wanted was rejected</h1>
3
+ <p>Maybe you tried to change something you didn't have access to</p>
4
4
  </div>
@@ -1,3 +1,3 @@
1
1
  .exception
2
- %h1 The change you wanted was rejected.
2
+ %h1 The change you wanted was rejected
3
3
  %p Maybe you tried to change something you didn't have access to.
@@ -1,5 +1,5 @@
1
1
  <div class="exception">
2
- <h1>We're sorry, but something went wrong.</h1>
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"
@@ -1,5 +1,5 @@
1
1
  .exception
2
- %h1 We're sorry, but something went wrong.
2
+ %h1 We're sorry, but something went wrong
3
3
  %p We've been notified about this issue and we'll take a look at it shortly.
4
4
  %p
5
5
  %small
@@ -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
- render :template => "/exceptions/#{status}", :status => status
29
- if response_code != :not_found
30
- Lipsiadmin::Mailer::ExceptionNotifier.deliver_exception(exception, self, request)
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: Lipsiasoft-exception-notifier
3
3
  version: !ruby/object:Gem::Version
4
- version: "1.0"
4
+ version: "1.1"
5
5
  platform: ruby
6
6
  authors:
7
7
  - Davide D'Agostino