mirror of
https://github.com/supabase/supabase.git
synced 2026-05-08 01:40:13 -04:00
4a0bb36ca8
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
10 lines
390 B
TypeScript
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 ?? ''] }
|
|
}
|