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

Function getErrMsg

src/error.ts:42–51  ·  view source on GitHub ↗
(err: unknown, defaultMsg?: string)

Source from the content-addressed store, hash-verified

40 * @return An error string
41 */
42export function getErrMsg(err: unknown, defaultMsg?: string): string {
43 if (err instanceof Error) {
44 return err.message;
45 } else if (typeof err === "string") {
46 return err;
47 } else if (defaultMsg) {
48 return defaultMsg;
49 }
50 return JSON.stringify(err);
51}
52
53/**
54 * Safely gets an error stack (or error message if no stack is available)

Callers 15

requirePermissionsFunction · 0.90
wrappedSafeLoadFunction · 0.90
getAccessTokenFunction · 0.90
installAgentSkillsFunction · 0.90
wantFunction · 0.90
askQuestionsFunction · 0.90
getPackageVersionFunction · 0.90
doSetupFunction · 0.90
updateTsConfigFunction · 0.90
installNpmPackagesFunction · 0.90
generateSampleFileFunction · 0.90
updatePackageJsonFunction · 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…