lib/bonsai/webserver.rb in bonsai-1.1.0 vs lib/bonsai/webserver.rb in bonsai-1.1.1

- old
+ new

@@ -6,14 +6,21 @@ @app.call(env) end end class DevelopmentServer < Sinatra::Base + set :views, "#{File.dirname(__FILE__)}/webserver" + get '/' do Page.find("index").render end get '/*' do - Page.find(params[:splat].to_s).render + begin + Page.find(params[:splat].to_s).render + rescue Bonsai::Page::NotFound => e + @error = e.message + erb :error + end end end end