From bd8a5861e7cf9f63d151fd11218561e0b5116d49 Mon Sep 17 00:00:00 2001 From: Tilman Vatteroth Date: Wed, 5 Apr 2023 11:23:25 +0200 Subject: [PATCH] feat: log error in note-loading-boundary Signed-off-by: Tilman Vatteroth --- .../common/note-loading-boundary/note-loading-boundary.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend/src/components/common/note-loading-boundary/note-loading-boundary.tsx b/frontend/src/components/common/note-loading-boundary/note-loading-boundary.tsx index 30f17df89..42648d2e5 100644 --- a/frontend/src/components/common/note-loading-boundary/note-loading-boundary.tsx +++ b/frontend/src/components/common/note-loading-boundary/note-loading-boundary.tsx @@ -5,6 +5,7 @@ */ import { ApiError } from '../../../api/common/api-error' import { ErrorToI18nKeyMapper } from '../../../api/common/error-to-i18n-key-mapper' +import { Logger } from '../../../utils/logger' import { LoadingScreen } from '../../application-loader/loading-screen/loading-screen' import { CommonErrorPage } from '../../error-pages/common-error-page' import { CustomAsyncLoadingBoundary } from '../async-loading-boundary/custom-async-loading-boundary' @@ -14,6 +15,8 @@ import { useLoadNoteFromServer } from './hooks/use-load-note-from-server' import type { PropsWithChildren } from 'react' import React, { useEffect, useMemo } from 'react' +const logger = new Logger('NoteLoadingBoundary') + /** * Loads the note identified by the note-id in the URL. * During the loading a {@link LoadingScreen loading screen} will be rendered instead of the child elements. @@ -37,6 +40,7 @@ export const NoteLoadingBoundary: React.FC = ({ children }) = .withHttpCode(403, 'forbidden') .withHttpCode(401, 'forbidden') .orFallbackI18nKey('other') + logger.error(error) return (