MCPcopy Create free account
hub / github.com/MCSManager/MCSManager / getValidatorErrorMsg

Function getValidatorErrorMsg

frontend/src/tools/validator.ts:14–25  ·  view source on GitHub ↗
(error: any, def: string = "")

Source from the content-addressed store, hash-verified

12}
13
14export function getValidatorErrorMsg(error: any, def: string = "") {
15 if (error.message) {
16 return error.message;
17 }
18 if (error.errorFields instanceof Array) {
19 return String(error.errorFields[0]?.errors[0] || "");
20 }
21 if (error === null || error === undefined) {
22 return def;
23 }
24 return String(error);
25}
26
27export function reportValidatorError(error: any) {
28 console.error("Function reportValidatorError():", error);

Callers 2

reportValidatorErrorFunction · 0.85
reportErrorMsgFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected