From 914e395b559c58200011ca7ece6db874bf686775 Mon Sep 17 00:00:00 2001 From: Pipat Saengow Date: Sat, 2 Sep 2023 16:55:15 +0700 Subject: [PATCH] hook an error logging for 404 course --- apps/api/src/course/course.service.ts | 2 +- apps/web/src/modules/CourseDetail/index.tsx | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/api/src/course/course.service.ts b/apps/api/src/course/course.service.ts index 1536cb9b6..a2daac748 100644 --- a/apps/api/src/course/course.service.ts +++ b/apps/api/src/course/course.service.ts @@ -29,7 +29,7 @@ export class CourseService { }) if (!course) { - throw new NotFoundError("Can't find a course with the given parameters") + throw new NotFoundError(`Can't find a course with the given parameters ${JSON.stringify({courseNo, semester, academicYear, studyProgram})}`) } return course } diff --git a/apps/web/src/modules/CourseDetail/index.tsx b/apps/web/src/modules/CourseDetail/index.tsx index 5368393bb..707202e95 100644 --- a/apps/web/src/modules/CourseDetail/index.tsx +++ b/apps/web/src/modules/CourseDetail/index.tsx @@ -246,6 +246,7 @@ export async function getServerSideProps( } } catch (e) { if (e instanceof ApolloError) { + console.warn(`CourseDetail not found query=${JSON.stringify(context.query)}`, e) return { notFound: true, }