({ title, slug, bodyLines }: CLIErrorMessageConfig)
| 113 | } |
| 114 | |
| 115 | error({ title, slug, bodyLines }: CLIErrorMessageConfig) { |
| 116 | this.addNewline(); |
| 117 | |
| 118 | this.writeOutputTitle({ |
| 119 | label: chalk.reset.inverse.bold.red(' ERROR '), |
| 120 | title: chalk.bold.red(title), |
| 121 | }); |
| 122 | |
| 123 | this.writeOptionalOutputBody(bodyLines); |
| 124 | |
| 125 | /** |
| 126 | * Optional slug to be used in an UB error message redirect URL |
| 127 | */ |
| 128 | if (slug && typeof slug === 'string') { |
| 129 | this.addNewline(); |
| 130 | this.writeToStdOut( |
| 131 | `${chalk.grey( |
| 132 | ' Learn more about this error: ' |
| 133 | )}https://errors.UB.dev/${slug}\n` |
| 134 | ); |
| 135 | } |
| 136 | |
| 137 | this.addNewline(); |
| 138 | } |
| 139 | |
| 140 | warn({ title, slug, bodyLines }: CLIWarnMessageConfig) { |
| 141 | this.addNewline(); |
no test coverage detected