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!

better error handling for project creation

Blue Mousedd5eec9c11c9
diff --git a/web/app/pages/Dashboard/Dashboard.tsx b/web/app/pages/Dashboard/Dashboard.tsx
index c217f8b1d..e5e9b837c 100644
--- a/web/app/pages/Dashboard/Dashboard.tsx
+++ b/web/app/pages/Dashboard/Dashboard.tsx
@@ -237,9 +237,18 @@ const Dashboard = () => {
toast.success(t('project.settings.created'))
closeNewProjectModal()
- } catch (reason: any) {
- setNewProjectError(reason)
- toast.error(reason)
+ } catch (reason: unknown) {
+ console.error('[ERROR] Error while creating project:', reason)
+
+ const normalizedMessage =
+ typeof reason === 'string'
+ ? reason
+ : (reason as any)?.response?.data?.message ||
+ (reason as any)?.message ||
+ t('apiNotifications.somethingWentWrong')
+
+ setNewProjectError(normalizedMessage)
+ toast.error(normalizedMessage)
} finally {
setIsNewProjectLoading(false)
}