mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 20:54:07 -08:00
fix(core): Error reporter should log all error on an error-chain (no-changelog) (#5342)
This commit is contained in:
parent
6985500a7d
commit
51b560b3f4
|
@ -12,8 +12,15 @@ interface ErrorReporter {
|
|||
}
|
||||
|
||||
const instance: ErrorReporter = {
|
||||
report: (error) =>
|
||||
error instanceof Error && Logger.error(`${error.constructor.name}: ${error.message}`),
|
||||
report: (error) => {
|
||||
if (error instanceof Error) {
|
||||
let e = error;
|
||||
do {
|
||||
Logger.error(`${e.constructor.name}: ${e.message}`);
|
||||
e = e.cause as Error;
|
||||
} while (e);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
export function init(errorReporter: ErrorReporter) {
|
||||
|
|
Loading…
Reference in a new issue