Skip to content

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

Format 503 errors in AlertError (#21283)

Joshen Lim39f1fdae2f96
diff --git a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/SidePanelEditor.tsx b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/SidePanelEditor.tsx
index 89e11737435..bfacdc7e05e 100644
--- a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/SidePanelEditor.tsx
+++ b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/SidePanelEditor.tsx
@@ -135,11 +135,9 @@ const SidePanelEditor = ({
}
} else {
saveRowError = new Error('No primary key')
- ui.setNotification({
- category: 'error',
- message:
- "We can't make changes to this table because there is no primary key. Please create a primary key and try again.",
- })
+ toast.error(
+ "We can't make changes to this table because there is no primary key. Please create a primary key and try again."
+ )
}
}
}
@@ -176,13 +174,7 @@ const SidePanelEditor = ({
if (payload !== undefined && configuration !== undefined) {
try {
- await saveRow(payload, isNewRecord, configuration, (error) => {
- if (error) {
- toast.error(
- error?.message ?? 'Something went wrong while trying to save the column value'
- )
- }
- })
+ await saveRow(payload, isNewRecord, configuration, () => {})
} finally {
resolve()
}
diff --git a/apps/studio/components/ui/AlertError.tsx b/apps/studio/components/ui/AlertError.tsx
index 32690abf06a..d1b39f2c93e 100644
--- a/apps/studio/components/ui/AlertError.tsx
+++ b/apps/studio/components/ui/AlertError.tsx
@@ -25,13 +25,17 @@ const AlertError = ({ ref, subject, error, className }: AlertErrorProps) => {
if (subjectString) href += `&subject=${subjectString}`
if (error) href += `&message=Error:%20${error.message}`
+ const formattedErrorMessage = error?.message.includes('503')
+ ? '503 Service Temporarily Unavailable'
+ : error?.message
+
return (
<Alert_Shadcn_ className={className} variant="warning" title={subject}>
<IconAlertCircle className="h-4 w-4" strokeWidth={2} />
<AlertTitle_Shadcn_>{subject}</AlertTitle_Shadcn_>
<AlertDescription_Shadcn_ className="flex flex-col gap-3">
<div>
- {error?.message && <p>Error: {error?.message}</p>}
+ {error?.message && <p>Error: {formattedErrorMessage}</p>}
<p>
Try refreshing your browser, but if the issue persists, please reach out to us via
support.