How my boss made InternalServerErrors disappear
By Angus Cheng
He didn’t do this:
try {
// entire app
}
catch (t: Throwable) {
t.printStackTrace()
}
He did this:
try {
// entire app
}
catch (t: Throwable) {
val developerEmails = listOf("dev1@gmail.com", "dev2@gmail.com")
emailTransport.sendEmail(developerEmails, e.message, e.stackTraceToString())
throw t
}
Whenever an unexpected error occurs, everyone on the team gets an email about it. We would go into the office, see a bunch of these error emails and then talk about them in the morning standup. Usually they were fixed that day.
It wasn’t a perfect system, I remember one time we sent out tens of thousands of emails and took down the company’s email server. This was also particularly funny because it filled up our bosses inbox while he was on block leave1. This meant he wasn’t able to clear his inbox and wasn’t able to receive new messages.
Something like this is good though, because Internal Server Errors shouldn’t happen, and if you aren’t aware of them you probably won’t fix them.