EditorPanel.utils.ts 390 B

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