mirror of
https://github.com/supabase/supabase.git
synced 2026-10-06 01:45:10 +03:00
Format 503 errors in AlertError (#21283)
* Format 503 errors in AlertError * Small fix
This commit is contained in:
1 parent
dd444f54b8
commit
39f1fdae2f
2 files changed
+9
-13
No files matched your search
+4
-12
@@ -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()
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in new issue
Block a user