acrisci / simple-breakpad-server

Simple breakpad crash reports collecting server
https://www.npmjs.com/package/simple-breakpad-server
MIT License
67 stars 29 forks source link

Fix ReferenceError if symfile is not included in form #12

Closed emiro85 closed 7 years ago

emiro85 commented 7 years ago

res is not defined in this scope

acrisci commented 7 years ago

Will it still set the status to 400 with this change?

emiro85 commented 7 years ago

No it doesn't set 400 anymore. This is because I couldn't find a place where the status is actually used. If I understood the code right, the execution jumps straight to the error handler in case of this error. From there it returns res.status(500).send "Bad things happened:<br/> #{err.message || err}". Did I miss something?

The alternative would be to handle the error earlier, e.g. instead of return next(err) if err? do return res.status(400).send err

Btw. is there a typo in resturn? :https://github.com/acrisci/simple-breakpad-server/blob/616a282da514a84a9deaa69f5686be905518352f/src/app.coffee#L244

acrisci commented 7 years ago

Ok let's fix the 400 error later then.