From 38b2914e709caac431aa62dccc103b4c249cc13a Mon Sep 17 00:00:00 2001 From: Kyle Drake Date: Sat, 13 Jul 2013 11:01:13 -0400 Subject: [PATCH] error reporting --- app.rb | 12 ++++++++++++ views/error.slim | 5 +++++ 2 files changed, 17 insertions(+) create mode 100644 views/error.slim diff --git a/app.rb b/app.rb index 7143abdc..c635b8f5 100644 --- a/app.rb +++ b/app.rb @@ -16,6 +16,17 @@ not_found do slim :'not_found' end +error do + EmailWorker.perform_async({ + from: 'web@neocities.org', + to: 'errors@neocities.org', + subject: "[NeoCities Error] #{env['sinatra.error'].name}", + body: "#{env['sinatra.error'].message}\n\n#{env['sinatra.error'].backtrace}" + }) + + slim :'error' +end + get '/?' do dashboard_if_signed_in slim :index @@ -423,6 +434,7 @@ get '/password_reset_confirm' do end get '/contact' do + raise 'hell' slim :'contact' end diff --git a/views/error.slim b/views/error.slim new file mode 100644 index 00000000..fb40b6de --- /dev/null +++ b/views/error.slim @@ -0,0 +1,5 @@ +.row + .span8.offset2.text-center + h2 Site Error + h4 There has been an error performing the requested action. We have been notified of the problem. + h5 If you need to add any special information or if this error has not been resolved in a while, contact us and report the problem. Thank you! \ No newline at end of file