MCPcopy Index your code
hub / github.com/di-sukharev/opencommit / getErrorMessage

Function getErrorMessage

out/cli.cjs:74910–74926  ·  view source on GitHub ↗
(e3)

Source from the content-addressed store, hash-verified

74908function isError(e3) {
74909 if (isObject2(e3)) {
74910 const hasName = typeof e3.name === "string";
74911 const hasMessage = typeof e3.message === "string";
74912 return hasName && hasMessage;
74913 }
74914 return false;
74915}
74916function getErrorMessage(e3) {
74917 if (isError(e3)) {
74918 return e3.message;
74919 } else {
74920 let stringified;
74921 try {
74922 if (typeof e3 === "object" && e3) {
74923 stringified = JSON.stringify(e3);
74924 } else {
74925 stringified = String(e3);
74926 }
74927 } catch (err) {
74928 stringified = "[unable to stringify input]";
74929 }

Callers 4

tryCreateTracingClientFunction · 0.85
tryCreateSpanFunction · 0.85
tryProcessErrorFunction · 0.85
tryProcessResponseFunction · 0.85

Calls 1

isErrorFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…