@visulima/error
Version:
Error with more than just a message, stacktrace parsing.
22 lines (20 loc) • 545 B
JavaScript
const errorHintFinder = {
handle: async (error) => {
if (error.hint === void 0 || error.hint === null) {
return void 0;
}
if (typeof error.hint === "string" && error.hint !== "") {
return { body: error.hint };
}
if (typeof error.hint === "object" && typeof error.hint.body === "string") {
return error.hint;
}
if (Array.isArray(error.hint)) {
return { body: error.hint.join("\n") };
}
return void 0;
},
name: "errorHint",
priority: 1
};
export { errorHintFinder as default };