return an error when the user doesn't pass in another user
added some logging to createOrUnarchiveGroup which is where things broke down
added a middleware called logWhenError which logs only when an error happens
wired up the error middleware
Alright, is it rant time yet?!
<rant>
Hubot, in all its wisdom uses Express 3 instead of Express 4 which has been out forever! So error handling is all fucked up so what we had to do was hook into the promise error handler. The logWhenError function has to take exactly 4 parameters otherwise things break because Express 3 determines what kind of middleware it is by doing some bullshitass reflection and if it doesn't take 4 parameters, then things literally don't work. 👏 Wow, just wow.
</rant>
createOrUnarchiveGroup
which is where things broke downlogWhenError
which logs only when an error happensAlright, is it rant time yet?!
<rant>
Hubot, in all its wisdom uses Express 3 instead of Express 4 which has been out forever! So error handling is all fucked up so what we had to do was hook into the promise error handler. ThelogWhenError
function has to take exactly 4 parameters otherwise things break because Express 3 determines what kind of middleware it is by doing some bullshitass reflection and if it doesn't take 4 parameters, then things literally don't work. 👏 Wow, just wow.</rant>
Anyway, please review.