mirror of
https://github.com/Tria-plc/emaui.git
synced 2026-08-27 10:52:54 +00:00
16 lines
677 B
JavaScript
16 lines
677 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
|
|
exports.getShortErrorMsg = getShortErrorMsg;
|
|
//# sourceMappingURL=getShortErrorMsg.cjs.map
|