Files
emaui/node_modules/@module-federation/error-codes/dist/getShortErrorMsg.mjs
2026-05-29 15:23:46 +03:00

15 lines
660 B
JavaScript

//#region src/getShortErrorMsg.ts
const getDocsUrl = (errorCode) => {
return `View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${errorCode.split("-")[0].toLowerCase()}#${errorCode.toLowerCase()}`;
};
const getShortErrorMsg = (errorCode, errorDescMap, args, originalErrorMsg) => {
const msg = [`${[errorDescMap[errorCode]]} #${errorCode}`];
args && msg.push(`args: ${JSON.stringify(args)}`);
msg.push(getDocsUrl(errorCode));
originalErrorMsg && msg.push(`Original Error Message:\n ${originalErrorMsg}`);
return msg.join("\n");
};
//#endregion
export { getShortErrorMsg };
//# sourceMappingURL=getShortErrorMsg.mjs.map