Skip to content

Commit

Permalink
Change error log level by status (#1298)
Browse files Browse the repository at this point in the history
  • Loading branch information
codemonkey800 authored Dec 9, 2023
1 parent 5698c4c commit 074957f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion frontend/src/pages/plugins/[name].tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { inRange } from 'lodash';
import Head from 'next/head';
import { useTranslation } from 'next-i18next';
import { ParsedUrlQuery } from 'node:querystring';
Expand Down Expand Up @@ -65,7 +66,11 @@ export const getServerSideProps = getServerSidePropsHandler<Props, Params>({
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,
Expand Down

0 comments on commit 074957f

Please sign in to comment.