@credo-ts/core
Version:
<p align="center"> <br /> <img alt="Credo Logo" src="https://github.com/openwallet-foundation/credo-ts/blob/c7886cb8377ceb8ee4efe8d264211e561a75072d/images/credo-logo.png" height="250px" /> </p> <h1 align="center"><b>Credo - Core</b></h1
19 lines (18 loc) • 624 B
JavaScript
//#region src/logger/replaceError.ts
function replaceError(_, value) {
/**
* This special handling for error classes is mostly to not hide error messages in React Native.
* The error serialization works differently from node, so a lot of times you get `error: {}`, which
* really compliactes debugging.
*/
if (value instanceof Error) return {
serialized: "toJSON" in value && typeof value.toJSON === "function" ? value.toJSON() : value.toString(),
message: value.message,
name: value.name,
stack: value.stack
};
return value;
}
//#endregion
export { replaceError };
//# sourceMappingURL=replaceError.mjs.map