Track bundled vendor runtime sources
Some checks failed
CI / main (push) Has been cancelled
CI / release-e2e (push) Has been cancelled

This commit is contained in:
2026-07-07 10:05:50 +08:00
parent fbe179ab53
commit 52636c91ae
2111 changed files with 1850012 additions and 14 deletions

View File

@@ -0,0 +1,24 @@
export const mapError = (e) => {
let msg = e;
if (e instanceof Error) {
msg = [e.message, e.stack].join("\n");
} else if (typeof e !== "string") {
msg = e.toString();
}
const map = {
// 'fetch error': '网络错误',
};
for (let key in map) {
if (msg.includes(key)) {
let error = map[key];
// regex PluginReleaseDocFormatError:-11
const regex = new RegExp(`${key}:(-?\\d+)`);
const match = msg.match(regex);
if (match) {
error += `(${match[1]})`;
}
return error;
}
}
return msg;
};