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!

fix: show API response text

Blue Mousee1b78c05b55a
diff --git a/web/app/pages/Project/Settings/Emails/Emails.tsx b/web/app/pages/Project/Settings/Emails/Emails.tsx
index 2f89953af..3757dd6c3 100644
--- a/web/app/pages/Project/Settings/Emails/Emails.tsx
+++ b/web/app/pages/Project/Settings/Emails/Emails.tsx
@@ -161,7 +161,7 @@ const EmailList = ({ data, onRemove, setEmails }: EmailListProps) => {
toast.success(t('apiNotifications.updatedPeriodEmailReports'))
} catch (reason: any) {
console.error(`[ERROR] Error while updating user's role: ${reason}`)
- toast.error(t('apiNotifications.updatedPeriodEmailReportsError'))
+ toast.error(typeof reason === 'string' ? reason : t('apiNotifications.updatedPeriodEmailReportsError'))
}
setOpen(false)
@@ -340,7 +340,7 @@ const Emails = ({ projectId }: { projectId: string }) => {
toast.success(t('apiNotifications.userInvited'))
} catch (reason) {
console.error(`[ERROR] Error while inviting a user: ${reason}`)
- toast.error(t('apiNotifications.userInviteError'))
+ toast.error(typeof reason === 'string' ? reason : t('apiNotifications.userInviteError'))
}
// a timeout is needed to prevent the flicker of data fields in the modal when closing