mirror of
https://github.com/neocities/neocities.git
synced 2025-04-25 01:32:36 +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
4
app.rb
4
app.rb
|
@ -42,9 +42,7 @@ error do
|
||||||
from: 'web@neocities.org',
|
from: 'web@neocities.org',
|
||||||
to: 'errors@neocities.org',
|
to: 'errors@neocities.org',
|
||||||
subject: "[Neocities Error] #{env['sinatra.error'].class}: #{env['sinatra.error'].message}",
|
subject: "[Neocities Error] #{env['sinatra.error'].class}: #{env['sinatra.error'].message}",
|
||||||
body: "#{request.request_method} #{request.path}\n\n" +
|
body: erb(:'views/templates/email/error')
|
||||||
(current_site ? "Site: #{current_site.username}\nEmail: #{current_site.email}\n\n" : '') +
|
|
||||||
env['sinatra.error'].backtrace.join("\n")
|
|
||||||
})
|
})
|
||||||
|
|
||||||
if @api
|
if @api
|
||||||
|
|
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