[all-commits] [llvm/llvm-project] 37e13d: [mlir-lsp] Log invalid notification params (#89856)

Brian Gesiak via All-commits all-commits at lists.llvm.org
Wed Apr 24 12:15:00 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 37e13d4924841bd84edb8c67c667d6d2a6c2bc63
      https://github.com/llvm/llvm-project/commit/37e13d4924841bd84edb8c67c667d6d2a6c2bc63
  Author: Brian Gesiak <brian at modocache.io>
  Date:   2024-04-24 (Wed, 24 Apr 2024)

  Changed paths:
    M mlir/include/mlir/Tools/lsp-server-support/Transport.h
    M mlir/unittests/Tools/lsp-server-support/Transport.cpp

  Log Message:
  -----------
  [mlir-lsp] Log invalid notification params (#89856)

When the `lsp::MessageHandler` processes a request with invalid params
(that is, the "params" JSON sent along with the request does not match
the shape expected by the message handler for the given method), it
replies by sending an error response to the client.

On the other hand, the language server protocol specifies that
notifications must not result in responses. As a result, when the
JSON params accompanying a notification cannot be parsed, no error is
sent back; there is no indication that an error has occurred at all.

This patch adds an error log for that case. Although clients cannot
parse error logs, this at least provides an indication that something
went wrong on the language server side.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list