mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +02:00
better error reporting to help fix bugs
This commit is contained in:
parent
b782632b69
commit
d56edd80ec
2 changed files with 14 additions and 4 deletions
6
app.rb
6
app.rb
|
@ -42,9 +42,7 @@ error do
|
|||
from: 'web@neocities.org',
|
||||
to: 'errors@neocities.org',
|
||||
subject: "[Neocities Error] #{env['sinatra.error'].class}: #{env['sinatra.error'].message}",
|
||||
body: "#{request.request_method} #{request.path}\n\n" +
|
||||
(current_site ? "Site: #{current_site.username}\nEmail: #{current_site.email}\n\n" : '') +
|
||||
env['sinatra.error'].backtrace.join("\n")
|
||||
body: erb(:'views/templates/email/error')
|
||||
})
|
||||
|
||||
if @api
|
||||
|
@ -54,4 +52,4 @@ error do
|
|||
erb :'error'
|
||||
end
|
||||
|
||||
Dir['./app/**/*.rb'].each {|f| require f}
|
||||
Dir['./app/**/*.rb'].each {|f| require f}
|
||||
|
|
12
views/templates/email/error.erb
Normal file
12
views/templates/email/error.erb
Normal file
|
@ -0,0 +1,12 @@
|
|||
<%= request.request_method %> <%= request.path %>
|
||||
|
||||
<% if current_site %>
|
||||
Site: <%= current_site.username %>
|
||||
Email: <%= current_site.email %>
|
||||
<% end %>
|
||||
|
||||
Params:
|
||||
<%= params.inspect %>
|
||||
|
||||
Backtrace:
|
||||
<%= env['sinatra.error'].backtrace.join("\n") %>
|
Loading…
Add table
Reference in a new issue