Skip to content

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

390 B
Raw Blame
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 ?? ''] }
}