(err: PrintableError, opts: FormatErrorOptions = {})
| 28 | } |
| 29 | |
| 30 | export function formatErrorForCli(err: PrintableError, opts: FormatErrorOptions = {}): string { |
| 31 | const env = err.toEnvelope() |
| 32 | if (opts.format === 'json') |
| 33 | return renderEnvelope(env) |
| 34 | return renderHuman(env, opts.isErrTTY ?? false) |
| 35 | } |
| 36 | |
| 37 | function renderEnvelope(env: ErrorEnvelope): string { |
| 38 | const raw = env.error.raw_response |
no test coverage detected