From 6910461b7684e768b8f6d593cbedeb580a4e9428 Mon Sep 17 00:00:00 2001 From: Andrew Nagy Date: Wed, 12 Jan 2022 21:04:35 +0000 Subject: [PATCH] Catch additional InvalidArgumentException --- src/Psalm/Internal/LanguageServer/Server/TextDocument.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Psalm/Internal/LanguageServer/Server/TextDocument.php b/src/Psalm/Internal/LanguageServer/Server/TextDocument.php index b98b5161638..d495090e242 100644 --- a/src/Psalm/Internal/LanguageServer/Server/TextDocument.php +++ b/src/Psalm/Internal/LanguageServer/Server/TextDocument.php @@ -6,6 +6,7 @@ use Amp\Promise; use Amp\Success; +use InvalidArgumentException; use LanguageServerProtocol\CompletionList; use LanguageServerProtocol\Hover; use LanguageServerProtocol\Location; @@ -367,7 +368,7 @@ public function codeAction(TextDocumentIdentifier $textDocument, Range $range): try { $this->codebase->analyzer->analyzeFiles($this->project_analyzer, 1, false); - } catch (UnexpectedValueException $e) { + } catch (UnexpectedValueException | InvalidArgumentException $e) { error_log('codeAction errored on file ' . $file_path. ', Reason: '.$e->getMessage()); return new Success(null); }