Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a comment to avoid throwing errors from within logger.log() #536

Merged
merged 1 commit into from
Nov 4, 2021

Conversation

rocketnova
Copy link
Contributor

Ticket

Changes

  • Adds a comment

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 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.

@rocketnova rocketnova merged commit 1a14c3f into main Nov 4, 2021
@rocketnova rocketnova deleted the rocket/471-comment branch November 4, 2021 16:33
rocketnova added a commit that referenced this pull request Nov 9, 2021
29a66b5 Update application insights to 2.1.8 (#537)
1a14c3f Add a comment to avoid throwing errors from within logger.log (#536)
48390ea Add an environment variable for more flexibility for static asset path (#525)
8e9b3c6 Update to latest chromatic (#533)
17c5766 Update ansi-regex (#535)
f803ae6 Log a UUID for all traces in a single request/response cycle using a pino child logger (#523)
97c30f3 Adds an error catch for null responses
62bfe42 Fine tunes & then hides the Global Header on main
f871c44 Run CI on future and PRs against future & production
a40fbf1 Flexible context root
c89a69c Creates the Global Header
d79ff60 Bump semver-regex from 3.1.2 to 3.1.3 (#499)
6e5dfae Bump nth-check from 2.0.0 to 2.0.1 (#498)
5183e49 Bump prismjs from 1.24.1 to 1.25.0 (#497)
273f813 Bump tmpl from 1.0.4 to 1.0.5 (#496)
3bd7615 Security update: set-value (#495)
f48d2cf Adds storybooks for Maintenance Component & Page under Maintenance
d30ff5e Update dependencies (#488)
2be865a Missing Application Insights environment variable should not disrupt claimant experience (#469)
5ea5fe3 Update modheader instructions in readme
0f32698 Remove default argument values in InfoField (#463)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Display 500 message for any uncaught errors
2 participants