Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

More whitelisting non critical errors (#27057)

Joshen Lim72fd5f512146
diff --git a/apps/studio/components/interfaces/SignIn/ForgotPasswordForm.tsx b/apps/studio/components/interfaces/SignIn/ForgotPasswordForm.tsx
index ecf748732f8..cb88f8ccab0 100644
--- a/apps/studio/components/interfaces/SignIn/ForgotPasswordForm.tsx
+++ b/apps/studio/components/interfaces/SignIn/ForgotPasswordForm.tsx
@@ -9,6 +9,8 @@ import { useResetPasswordMutation } from 'data/misc/reset-password-mutation'
import { BASE_PATH } from 'lib/constants'
import { Button, Form, Input } from 'ui'
+const WHITELIST_ERRORS = ['email must be an email']
+
const forgotPasswordSchema = object({
email: string().email('Must be a valid email').required('Email is required'),
})
@@ -29,7 +31,10 @@ const ForgotPasswordForm = () => {
setCaptchaToken(null)
captchaRef.current?.resetCaptcha()
toast.error(`Failed to send reset email: ${error.message}`)
- Sentry.captureMessage('[CRITICAL] Failed to send reset password email: ' + error.message)
+
+ if (!WHITELIST_ERRORS.some((e) => error.message.includes(e))) {
+ Sentry.captureMessage('[CRITICAL] Failed to send reset password email: ' + error.message)
+ }
},
})
diff --git a/apps/studio/components/interfaces/SignIn/ResetPasswordForm.tsx b/apps/studio/components/interfaces/SignIn/ResetPasswordForm.tsx
index 9d8bae740db..0f9ce861fda 100644
--- a/apps/studio/components/interfaces/SignIn/ResetPasswordForm.tsx
+++ b/apps/studio/components/interfaces/SignIn/ResetPasswordForm.tsx
@@ -6,7 +6,10 @@ import { auth } from 'lib/gotrue'
import { passwordSchema } from 'lib/schemas'
import { Button, Form, Input } from 'ui'
-const WHITELIST_ERRORS = ['New password should be different from the old password']
+const WHITELIST_ERRORS = [
+ 'New password should be different from the old password',
+ 'Password is known to be weak and easy to guess, please choose a different one',
+]
const ResetPasswordForm = () => {
const router = useRouter()
@@ -23,7 +26,7 @@ const ResetPasswordForm = () => {
await router.push('/projects')
} else {
toast.error(`Failed to save password: ${error.message}`, { id: toastId })
- if (!WHITELIST_ERRORS.includes(error.message)) {
+ if (!WHITELIST_ERRORS.some((e) => error.message.includes(e))) {
Sentry.captureMessage('[CRITICAL] Failed to reset password: ' + error.message)
}
}
diff --git a/apps/studio/data/projects/project-create-mutation.ts b/apps/studio/data/projects/project-create-mutation.ts
index 937eec659b2..5ba8b0c5246 100644
--- a/apps/studio/data/projects/project-create-mutation.ts
+++ b/apps/studio/data/projects/project-create-mutation.ts
@@ -8,6 +8,11 @@ import { PROVIDERS } from 'lib/constants'
import type { ResponseError } from 'types'
import { projectKeys } from './keys'
+const WHITELIST_ERRORS = [
+ 'The following organization members have reached their maximum limits for the number of active free projects',
+ 'db_pass must be longer than or equal to 4 characters',
+]
+
export type DbInstanceSize = components['schemas']['DesiredInstanceSize']
export type ProjectCreateVariables = {
@@ -84,7 +89,9 @@ export const useProjectCreateMutation = ({
} else {
onError(data, variables, context)
}
- Sentry.captureMessage('[CRITICAL] Failed to create project: ' + data.message)
+ if (!WHITELIST_ERRORS.some((error) => data.message.includes(error))) {
+ Sentry.captureMessage('[CRITICAL] Failed to create project: ' + data.message)
+ }
},
...options,
}