diff --git a/common/components/graphics/ChartPlaceHolder.tsx b/common/components/graphics/ChartPlaceHolder.tsx index 7416d00bb..cec607551 100644 --- a/common/components/graphics/ChartPlaceHolder.tsx +++ b/common/components/graphics/ChartPlaceHolder.tsx @@ -17,7 +17,7 @@ export const ChartPlaceHolder: React.FC = ({ const isError = query?.isError || readyState === 'error'; return (
- {isError ? : } + {isError ? : }
); }; diff --git a/common/components/notices/ErrorNotice.tsx b/common/components/notices/ErrorNotice.tsx index b997707b1..4dd3c7101 100644 --- a/common/components/notices/ErrorNotice.tsx +++ b/common/components/notices/ErrorNotice.tsx @@ -2,17 +2,22 @@ import { faTriangleExclamation } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import classNames from 'classnames'; import React from 'react'; +import type { UseQueryResult } from '@tanstack/react-query'; import { useDelimitatedRoute } from '../../utils/router'; import { mbtaTextConfig } from '../../styles/general'; interface ErrorNoticeProps { + query?: UseQueryResult; isWidget?: boolean; inverse?: boolean; } -export const ErrorNotice: React.FC = ({ isWidget, inverse }) => { +export const ErrorNotice: React.FC = ({ isWidget, inverse, query }) => { const { line } = useDelimitatedRoute(); + const errorMessage = query?.error?.['message']; + const timeout = errorMessage === 'network request failed'; + const color = !inverse && line ? mbtaTextConfig[line] : undefined; return (
= ({ isWidget, inverse }) = )} > - <>An error has occurred + {timeout ? ( + <> +

The response took too long

+

Try shrinking the date range and try again

+ + ) : ( +

An error has occurred

+ )}
); }; diff --git a/server/app.py b/server/app.py index 98b96a64f..fb43fddf6 100644 --- a/server/app.py +++ b/server/app.py @@ -49,7 +49,7 @@ def healthcheck(): checks = { "API Key Present": (lambda: len(secrets.MBTA_V2_API_KEY) > 0), "S3 Headway Fetching": ( - lambda: "2020-11-07 10:33:40" + lambda: "2020-11-07T10:33:40" in json.dumps(data_funcs.headways(date(year=2020, month=11, day=7), ["70061"])) ), "Performance API Check": (