This repo contains the Claim Status Tracker app, which helps Californians better understand what’s happening with their unemployment claim and benefits.
9
stars
4
forks
source link
Add a comment to avoid throwing errors from within logger.log() #536
In #471, we identified that uncaught errors will cause the application to display an unrendered and untranslated 500 error page. After researching this issue, I came to the conclusion that there isn't an easy technical solution. We have already put all of our function calls inside try/catch blocks.
It is possible to generate an uncaught error if you throw new Error() inside of logger.log(). That's what caused the issue in #471. However, we have already removed that throw. This PR adds a comment to logger.log() to warn future developers away from accidentally re-introducing this issue.
Ticket
Changes
Context
In #471, we identified that uncaught errors will cause the application to display an unrendered and untranslated 500 error page. After researching this issue, I came to the conclusion that there isn't an easy technical solution. We have already put all of our function calls inside
try/catch
blocks.It is possible to generate an uncaught error if you
throw new Error()
inside oflogger.log()
. That's what caused the issue in #471. However, we have already removed that throw. This PR adds a comment tologger.log()
to warn future developers away from accidentally re-introducing this issue.