lib/bonsai/webserver.rb in bonsai-1.1.1 vs lib/bonsai/webserver.rb in bonsai-1.1.2
- old
+ new
@@ -9,16 +9,21 @@
class DevelopmentServer < Sinatra::Base
set :views, "#{File.dirname(__FILE__)}/webserver"
get '/' do
- Page.find("index").render
+ begin
+ Page.find("index").render
+ rescue
+ @error = e.message
+ erb :error
+ end
end
get '/*' do
begin
Page.find(params[:splat].to_s).render
- rescue Bonsai::Page::NotFound => e
+ rescue
@error = e.message
erb :error
end
end
end