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