creddy/src/lib/errors.js

18 lines
338 B
JavaScript
Raw Normal View History

export function getRootCause(error) {
if (error.source) {
return getRootCause(error.source);
}
else {
return error;
}
}
2024-07-02 09:57:02 -04:00
export function fullMessage(error) {
let msg = error?.msg ? error.msg : error;
if (error.source) {
msg = `${msg}: ${fullMessage(error.source)}`;
}
return msg
}