mirror of
https://github.com/jsbin/jsbin.git
synced 2026-01-25 15:38:56 +00:00
Upgrade error reporting to include headers and hash the subject
This commit is contained in:
parent
d6261a06db
commit
2faf997cfa
@ -93,13 +93,19 @@ module.exports = Observable.extend({
|
||||
delete session.user.email;
|
||||
}
|
||||
|
||||
var headers = utils.extend({}, req.headers);
|
||||
delete headers.cookie;
|
||||
|
||||
context = {
|
||||
name: err.name,
|
||||
message: err.message,
|
||||
stack: err.stack,
|
||||
body: JSON.stringify(req.body, null, 2),
|
||||
session: JSON.stringify(session, null, 2) || null,
|
||||
url: this.helpers.url(req.url, true)
|
||||
url: this.helpers.url(req.url, true),
|
||||
path: req.url,
|
||||
headers: JSON.stringify(headers) || null,
|
||||
method: req.method
|
||||
};
|
||||
|
||||
if (context.body === '{}') {
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
var Observable = require('../utils').Observable,
|
||||
errors = require('../errors');
|
||||
errors = require('../errors'),
|
||||
crypto = require('crypto');
|
||||
|
||||
module.exports = Observable.extend({
|
||||
constructor: function MailHandler(transport, render) {
|
||||
@ -18,9 +19,9 @@ module.exports = Observable.extend({
|
||||
}
|
||||
|
||||
_this.sendMail({
|
||||
from: "JSBin <dave-the-robot@jsbin.com>",
|
||||
from: "Dave <dave-the-robot@jsbin.com>",
|
||||
to: to,
|
||||
subject: 'JSBin Password Reset',
|
||||
subject: 'JS Bin Password Reset',
|
||||
text: body
|
||||
}, fn);
|
||||
});
|
||||
@ -33,10 +34,12 @@ module.exports = Observable.extend({
|
||||
return fn(err);
|
||||
}
|
||||
|
||||
var hash = crypto.createHash('md5').update(body).digest('hex').slice(0, 6);
|
||||
|
||||
_this.sendMail({
|
||||
from: "JSBin <dave-the-robot@jsbin.com>",
|
||||
from: "Dave <dave-the-robot@jsbin.com>",
|
||||
to: to,
|
||||
subject: 'JSBin Internal Server Error',
|
||||
subject: 'JS Bin Crash Report: ' + context.message + ' ' + hash,
|
||||
text: body
|
||||
}, fn);
|
||||
});
|
||||
|
||||
@ -4,17 +4,23 @@ So JSBin blew up accessing: {{url}}
|
||||
|
||||
{{stack}}
|
||||
|
||||
{{method}} {{path}}
|
||||
{{headers}}
|
||||
|
||||
{{#body}}
|
||||
POST Body:
|
||||
|
||||
{{{body}}}
|
||||
|
||||
{{/body}}
|
||||
|
||||
{{#session}}
|
||||
Session:
|
||||
|
||||
{{{session}}}
|
||||
|
||||
{{/session}}
|
||||
|
||||
Cheers,
|
||||
Dave
|
||||
|
||||
Dave
|
||||
Loading…
x
Reference in New Issue
Block a user