MCPcopy Create free account
hub / github.com/firebase/firebase-tools / logError

Function logError

src/logError.ts:4–26  ·  view source on GitHub ↗
(error: any)

Source from the content-addressed store, hash-verified

2import * as clc from "colorette";
3
4export 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}

Callers 2

errorOutFunction · 0.90
logError.spec.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…