cagov / ui-claim-tracker

This repo contains the Claim Status Tracker app, which helps Californians better understand what’s happening with their unemployment claim and benefits.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Missing Application Insights env var results in unexpected page render

rocketnova opened this issue · comments

Description

While working on #432, I discovered that when the App Insights environment variable is missing, CST displays the following:

Screen Shot 2021-09-08 at 4 19 02 PM

This is unexpected.

Acceptance Criteria

  • Identify what's going on
  • Make any necessary fix so that a missing App Insights env var renders nicely

@lomky (CC @nicoleslaw @dianagriffin). It turns out that when an error is thrown and we do not catch it, this is what is displayed (see ticket description). Is this an issue we want to fix? I think it's pretty rare, but still possible that we may have uncaught errors and we probably want to display something nicer. If so, can you open a new ticket for it?

Details: It turns out that this throw new Error wasn't getting caught and was resulting in this render.

log(logFn: LogFunction, mergingObject: object, message: string): void {
if (this.pino === undefined) {
throw new Error('Pino is undefined')
} else {

I can open a ticket on this one. @dianagriffin do you think it makes sense to display the 500 message here even though it's not a 500 error?

Relates to #467

@nicoleslaw I agree that the 500 message is generic enough to make sense/be generally accurate from the user perspective.