1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-22 13:51:54 +01:00

log an error outside of requests

This commit is contained in:
Andrew Nagy 2022-02-02 22:19:52 +00:00
parent 81418e2ce0
commit 2093a28182

View File

@ -167,6 +167,9 @@ class LanguageServer extends Dispatcher
$e
);
}
if ($error !== null) {
$this->logError($error->message);
}
// Only send a Response for a Request
// Notifications do not send Responses
/**
@ -175,7 +178,6 @@ class LanguageServer extends Dispatcher
*/
if (Request::isRequest($msg->body)) {
if ($error !== null) {
$this->logError($error->message);
$responseBody = new ErrorResponse($msg->body->id, $error);
} else {
$responseBody = new SuccessResponse($msg->body->id, $result);