mirror of
https://github.com/sinatra/sinatra
synced 2023-03-27 23:18:01 -04:00
error page
This commit is contained in:
parent
44d65cb089
commit
05d0c82e35
2 changed files with 12 additions and 1 deletions
9
files/error.erb
Normal file
9
files/error.erb
Normal file
|
@ -0,0 +1,9 @@
|
|||
<h2>Error!</h2>
|
||||
|
||||
<h3>
|
||||
<%= @error.message %>
|
||||
</h3>
|
||||
|
||||
<div id="backtrace">
|
||||
<%= @error.backtrace.join('<br/>') %>
|
||||
</div>
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue