mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
refactor: Improve error logging/reporting for cli (#4691)
* use response error classes instead of `ResponseError` everywhere * improve error logging in dev mode or when telemetry is disabled
This commit is contained in:
committed by
GitHub
parent
5364e7fc92
commit
0b754a4f85
@@ -11,10 +11,9 @@ interface ErrorReporter {
|
||||
report: (error: Error | string, options?: ReportingOptions) => void;
|
||||
}
|
||||
|
||||
const isProduction = process.env.NODE_ENV === 'production';
|
||||
|
||||
const instance: ErrorReporter = {
|
||||
report: (error, options) => isProduction && Logger.error('ERROR', { error, options }),
|
||||
report: (error) =>
|
||||
error instanceof Error && Logger.error(`${error.constructor.name}: ${error.message}`),
|
||||
};
|
||||
|
||||
export function init(errorReporter: ErrorReporter) {
|
||||
|
||||
Reference in New Issue
Block a user