lib/bonsai/webserver.rb in bonsai-1.1.2 vs lib/bonsai/webserver.rb in bonsai-1.1.3

- old
+ new

@@ -4,27 +4,27 @@ result = super return result unless result[0] == 404 || result[0] == "404" @app.call(env) end end - + class DevelopmentServer < Sinatra::Base set :views, "#{File.dirname(__FILE__)}/webserver" - + get '/' do begin Page.find("index").render - rescue - @error = e.message + rescue Exception => e + @error = e erb :error end end - + get '/*' do begin - Page.find(params[:splat].to_s).render - rescue - @error = e.message + Page.find(params[:splat].join).render + rescue Exception => e + @error = e erb :error end end end end