openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
25 lines (24 loc) • 941 B
JavaScript
import { a as extractErrorCode, c as formatErrorStackWithMessage, s as formatErrorMessage$1 } from "./error-coercion-hDrHOSGy.mjs";
import { s as redactSensitiveText } from "./redact-Mj7pppxC.mjs";
import "./errno-DFcoqIT9.mjs";
//#region src/infra/errors.ts
function readErrorCause(e) {
if (!e || typeof e !== "object") return;
return e.cause;
}
function formatErrorMessage(e) {
return formatErrorMessage$1(e, { redact: redactSensitiveText });
}
function formatErrorMessageWithCode(e) {
return formatErrorMessage$1(e, {
includeCode: true,
redact: redactSensitiveText
});
}
function formatUncaughtError(e) {
if (extractErrorCode(e) === "INVALID_CONFIG") return formatErrorMessage(e);
if (e instanceof Error) return redactSensitiveText(formatErrorStackWithMessage(e));
return formatErrorMessage(e);
}
//#endregion
export { readErrorCause as i, formatErrorMessageWithCode as n, formatUncaughtError as r, formatErrorMessage as t };