From 074957fc12fa32c91d1e5a8a057b337e1ab57338 Mon Sep 17 00:00:00 2001 From: Jeremy Asuncion Date: Fri, 8 Dec 2023 18:30:00 -0800 Subject: [PATCH] Change error log level by status (#1298) --- frontend/src/pages/plugins/[name].tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/src/pages/plugins/[name].tsx b/frontend/src/pages/plugins/[name].tsx index 8ca7872e4..8ef022438 100644 --- a/frontend/src/pages/plugins/[name].tsx +++ b/frontend/src/pages/plugins/[name].tsx @@ -1,3 +1,4 @@ +import { inRange } from 'lodash'; import Head from 'next/head'; import { useTranslation } from 'next-i18next'; import { ParsedUrlQuery } from 'node:querystring'; @@ -65,7 +66,11 @@ export const getServerSideProps = getServerSidePropsHandler({ Object.assign(props, repoData); if (props.repoFetchError) { - logger.error({ + const logType = inRange(props.repoFetchError.status, 400, 500) + ? 'info' + : 'error'; + + logger[logType]({ message: 'Failed to fetch repo data', plugin: name, error: props.error,