From 5d364f98966aa86c5a24b75341597eeb01fce743 Mon Sep 17 00:00:00 2001 From: Nikita Barsukov Date: Fri, 29 Mar 2024 15:01:08 +0300 Subject: [PATCH] ci: improve `ServerErrorHandler` (#1175) --- projects/demo/src/app/server-error-handler.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/projects/demo/src/app/server-error-handler.ts b/projects/demo/src/app/server-error-handler.ts index ff48b543c..08bbb6921 100644 --- a/projects/demo/src/app/server-error-handler.ts +++ b/projects/demo/src/app/server-error-handler.ts @@ -10,12 +10,14 @@ const KNOWN_ISSUES: string[] = [ @Injectable() export class ServerErrorHandler implements ErrorHandler { - public handleError(error: Error): void { - if (KNOWN_ISSUES.some(issue => error.message.includes(issue))) { + public handleError(error: Error | string): void { + const errorMessage = (typeof error === 'string' ? error : error.message) || ''; + + if (KNOWN_ISSUES.some(issue => errorMessage.includes(issue))) { return; } - console.error(error); + console.error(errorMessage); if (hasFlag('--ci')) { process.exit(1);