Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

Errors: don't display message & line no / col if they're not present

Blue Mousec802b3e26491
diff --git a/web/app/pages/Project/View/components/ErrorDetails.tsx b/web/app/pages/Project/View/components/ErrorDetails.tsx
index 487a02915..9d92ed65f 100644
--- a/web/app/pages/Project/View/components/ErrorDetails.tsx
+++ b/web/app/pages/Project/View/components/ErrorDetails.tsx
@@ -26,12 +26,12 @@ export const ErrorDetails = ({ details }: IErrorDetailsComponent) => {
return (
<div className='mb-5 flex flex-wrap justify-center gap-5 lg:justify-start'>
<div className='flex flex-col'>
- <p className='font-bold text-slate-900 dark:text-gray-50 max-md:text-xl md:text-3xl'>{`${details.name}: ${details.message}`}</p>
+ <p className='font-bold text-slate-900 dark:text-gray-50 max-md:text-xl md:text-3xl'>{`${details.name}${details.message ? `: ${details.message}` : ''}`}</p>
<p className='text-sm font-medium text-slate-700 dark:text-gray-200'>
{t('dashboard.atFile', {
- filename: details.filename,
- lineno: details.lineno,
- colno: details.colno,
+ filename: details.filename ?? 'Unknown file',
+ lineno: details.lineno ?? 'N/A',
+ colno: details.colno ?? 'N/A',
})}
</p>
</div>
diff --git a/web/app/pages/Project/View/components/Errors.tsx b/web/app/pages/Project/View/components/Errors.tsx
index 3832172cb..2fe85af66 100644
--- a/web/app/pages/Project/View/components/Errors.tsx
+++ b/web/app/pages/Project/View/components/Errors.tsx
@@ -83,10 +83,16 @@ const ErrorItem = ({ error, onClick, className }: IErrorItem) => {
<div className='min-w-0 flex-auto'>
<p className='flex items-center gap-x-2 font-semibold leading-6 text-gray-900 dark:text-gray-50'>
<span className='text-base font-bold'>{error.name}</span>
- <Separator />
- <span className='mx-1 text-sm font-normal text-gray-500'>{error.filename}</span>
+ {error.filename ? (
+ <>
+ <Separator />
+ <span className='mx-1 text-sm font-normal text-gray-500'>{error.filename}</span>
+ </>
+ ) : null}
</p>
- <p className='mt-1 flex text-base leading-5 text-gray-500 dark:text-gray-300'>{error.message}</p>
+ {error.message ? (
+ <p className='mt-1 flex text-base leading-5 text-gray-500 dark:text-gray-300'>{error.message}</p>
+ ) : null}
<p className='mt-1 flex items-center gap-x-2 text-base leading-5 text-gray-500 dark:text-gray-300'>
<Badge className='mr-2 sm:hidden' label={status.label} colour={status.colour} />
{lastSeen}