Files
supabase/apps/studio/components/ui/EditorPanel/EditorPanel.utils.ts
2026-04-01 10:22:37 +02:00

10 lines
390 B
TypeScript

import type { SqlError } from '@/state/editor-panel-state'
export function formatSqlError(error: SqlError): { header: string | undefined; lines: string[] } {
if (error.formattedError) {
const lines = error.formattedError.split('\n').filter((l) => l.length > 0)
return { header: lines[0], lines: lines.slice(1) }
}
return { header: undefined, lines: [error.message ?? ''] }
}