From b9920ff0b827201a7f94a088d2f0e3a412310a4a Mon Sep 17 00:00:00 2001 From: Mateusz Jenek Date: Fri, 25 Oct 2024 17:14:01 +0200 Subject: [PATCH] fix: validation returns illegal state error --- src/services/ErrorHandlerService.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/services/ErrorHandlerService.ts b/src/services/ErrorHandlerService.ts index a5d89ef..e812ad8 100644 --- a/src/services/ErrorHandlerService.ts +++ b/src/services/ErrorHandlerService.ts @@ -17,6 +17,11 @@ export class ErrorHandlerService implements IErrorHandlerService { this.logger.error(error.details()); this.showErrorMessage(error.message()); } else if (error instanceof Error) { + // Validation may fail if the document change (old version is already disposed) during the validation process + if (error.message === 'illegal state - object is disposed') { + return; + } + this.logger.error( JSON.stringify({ message: error.message,