@adyen/adyen-platform-experience-web
Version:

33 lines (32 loc) • 1.04 kB
JavaScript
import { jsx as n } from "../../external/.pnpm/preact@10.28.2/node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js";
import { UNDEFINED_ERROR as m, getCommonErrorMessage as c } from "./getCommonErrorCode.js";
import a from "../internal/CopyText/CopyText.js";
const l = (r, o, e) => {
if (!r) return m;
const t = c(r, e);
if (t) return t;
switch (r.errorCode) {
case void 0:
return {
title: "common.errors.somethingWentWrong",
message: [o, "common.errors.retry"],
refreshComponent: !0
};
case "00_500": {
const s = e ? "common.errors.errorCode" : "common.errors.errorCodeSupport";
return {
title: "common.errors.somethingWentWrong",
message: [o, s],
translationValues: {
[s]: r.requestId ? /* @__PURE__ */ n(a, { copyButtonAriaLabelKey: "common.actions.copy.labels.errorCode", textToCopy: r.requestId }) : null
},
onContactSupport: e
};
}
default:
return m;
}
};
export {
l as getErrorMessage
};