]> git.eshelyaron.com Git - emacs.git/commit
Better jsonrpc.el workaround for debug-on-error check
authorJoão Távora <joaotavora@gmail.com>
Tue, 14 Mar 2023 19:07:23 +0000 (19:07 +0000)
committerJoão Távora <joaotavora@gmail.com>
Tue, 14 Mar 2023 19:36:47 +0000 (19:36 +0000)
commit2d835d64ba339bb375f0d55c4679149d6da3f209
tree108faa939f37b16b4a9b39d369cbb043f877b7d9
parenta55aaf9eaf203a4aedb0a492de2c33ab54b0b11c
Better jsonrpc.el workaround for debug-on-error check

Some extensions, notably ert.el, set `debug-on-error' to non-nil,
which makes it hard to test the behaviour catching of the Elisp
error when processing a request and replying to the endpoint with
an JSONRPC-error.

The previous workaround relied on requiring lisp/emacs-lisp/ert.el in
lisp/jsonrpc.el, which really doesn't make sense.

This is better.  For the single test of that behaviour, set a new
variable, jsonrpc-inhibit-debug-on-error.

Not only is this cleaner, it allows us to use ert.el's useful
debug-on-error setting.

* lisp/jsonrpc.el (ert): Don't require it.
(jsonrpc-inhibit-debug-on-error): New variable.
(jsonrpc-connection-receive): Use it.
(Package-Requires): Bump to 1.0.17

* test/lisp/jsonrpc-tests.el (signals-an--32603-JSONRPC-error):
Bind jsonrpc-inhibit-debug-on-error.
lisp/jsonrpc.el
test/lisp/jsonrpc-tests.el