adding exception notification support
parent
3bb7604e9c
commit
27443066a4
|
@ -1,15 +1,17 @@
|
||||||
class Exceptions < Application
|
class Exceptions < Application
|
||||||
|
include MerbExceptions::ControllerExtensions
|
||||||
|
|
||||||
# handle NotFound exceptions (404)
|
# handle NotFound exceptions (404)
|
||||||
def not_found
|
def not_found
|
||||||
@page_title = 'Error 404'
|
@page_title = 'Error 404'
|
||||||
@secondary_title = 'Document Not Found'
|
@secondary_title = 'Document Not Found'
|
||||||
render :format => :html
|
render_and_notify :format => :html
|
||||||
end
|
end
|
||||||
|
|
||||||
# handle NotAcceptable exceptions (406)
|
# handle NotAcceptable exceptions (406)
|
||||||
def not_acceptable
|
def not_acceptable
|
||||||
@page_title = 'Error 500'
|
@page_title = 'Error 500'
|
||||||
@secondary_title = 'Application Exception'
|
@secondary_title = 'Application Exception'
|
||||||
render :format => :html
|
render_and_notify :format => :html
|
||||||
end
|
end
|
||||||
end
|
end
|
|
@ -11,6 +11,7 @@ use_orm :activerecord
|
||||||
use_test :rspec
|
use_test :rspec
|
||||||
|
|
||||||
dependencies 'merb_helpers', 'merb_has_flash', 'merb-mailer'
|
dependencies 'merb_helpers', 'merb_has_flash', 'merb-mailer'
|
||||||
|
require 'merb_exceptions'
|
||||||
require 'redcloth'
|
require 'redcloth'
|
||||||
require 'RMagick'
|
require 'RMagick'
|
||||||
require 'memcache'
|
require 'memcache'
|
||||||
|
@ -24,4 +25,7 @@ Merb::BootLoader.after_app_loads do
|
||||||
memcache_connection_str = 'localhost:11211'
|
memcache_connection_str = 'localhost:11211'
|
||||||
end
|
end
|
||||||
CACHE = MemCache.new memcache_connection_str
|
CACHE = MemCache.new memcache_connection_str
|
||||||
|
|
||||||
|
Merb::Mailer.config = { :sendmail_path => '/usr/sbin/sendmail' }
|
||||||
|
Merb::Mailer.delivery_method = :sendmail
|
||||||
end
|
end
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
:exceptions:
|
||||||
|
:app_name: TuxBliki
|
||||||
|
:email_from: exceptions@penguincoder.org
|
||||||
|
:email_addresses:
|
||||||
|
- webmaster@penguincoder.org
|
Reference in New Issue