mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-26 21:19:43 -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 = {
|
const instance: ErrorReporter = {
|
||||||
report: (error) =>
|
report: (error) => {
|
||||||
error instanceof Error && Logger.error(`${error.constructor.name}: ${error.message}`),
|
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) {
|
export function init(errorReporter: ErrorReporter) {
|
||||||
|
|
Loading…
Reference in a new issue