From 05d0c82e353162eaf081a08e7ce76c5231855cb7 Mon Sep 17 00:00:00 2001 From: "blake.mizerany@gmail.com" Date: Tue, 25 Sep 2007 17:42:13 +0000 Subject: [PATCH] error page --- files/error.erb | 9 +++++++++ lib/sinatra/event.rb | 4 +++- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 files/error.erb diff --git a/files/error.erb b/files/error.erb new file mode 100644 index 00000000..81f5a5a6 --- /dev/null +++ b/files/error.erb @@ -0,0 +1,9 @@ +

Error!

+ +

+<%= @error.message %> +

+ +
+<%= @error.backtrace.join('
') %> +
diff --git a/lib/sinatra/event.rb b/lib/sinatra/event.rb index 36947bc3..deff9356 100644 --- a/lib/sinatra/event.rb +++ b/lib/sinatra/event.rb @@ -64,8 +64,10 @@ module Sinatra def error(value = nil) if value - @error = value status 500 + @error = value + views_dir SINATRA_ROOT + '/files/' + erb :error end @error end