(error: any)
| 2 | import * as clc from "colorette"; |
| 3 | |
| 4 | export function logError(error: any): void { |
| 5 | if (error.children && error.children.length) { |
| 6 | logger.error(clc.bold(clc.red("Error:")), clc.underline(error.message) + ":"); |
| 7 | error.children.forEach((child: any) => { |
| 8 | let out = "- "; |
| 9 | if (child.name) { |
| 10 | out += clc.bold(child.name) + " "; |
| 11 | } |
| 12 | out += child.message; |
| 13 | |
| 14 | logger.error(out); |
| 15 | }); |
| 16 | } else { |
| 17 | if (error.original) { |
| 18 | logger.debug(error.original.stack); |
| 19 | } |
| 20 | logger.error(); |
| 21 | logger.error(clc.bold(clc.red("Error:")), error.message); |
| 22 | } |
| 23 | if (error.context) { |
| 24 | logger.debug("Error Context:", JSON.stringify(error.context, undefined, 2)); |
| 25 | } |
| 26 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…