MCPcopy Create free account
hub / github.com/CommandCodeAI/BaseAI / getErrorMsg

Function getErrorMsg

packages/baseai/src/utils/memory/lib.ts:40–46  ·  view source on GitHub ↗
(error: any, defaultMsg: string)

Source from the content-addressed store, hash-verified

38}
39
40export const getErrorMsg = (error: any, defaultMsg: string) => {
41 const isErrorMessage = error instanceof Error;
42 const errorMessage = isErrorMessage
43 ? error.message.trim() || defaultMsg
44 : defaultMsg;
45 return errorMessage;
46};
47
48/**
49 * Formats the given number of bytes into a human-readable string representation.

Callers 1

checkDirectoryExistsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected