GNU bug report logs - #64888
28.2; jsonrpc.el; Function jsonrpc-error's error code is not correct

Previous Next

Package: emacs;

Reported by: YI YUE <includeyy123 <at> gmail.com>

Date: Thu, 27 Jul 2023 07:06:02 UTC

Severity: normal

Found in version 28.2

Done: João Távora <joaotavora <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 64888 in the body.
You can then email your comments to 64888 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#64888; Package emacs. (Thu, 27 Jul 2023 07:06:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to YI YUE <includeyy123 <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 27 Jul 2023 07:06:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: YI YUE <includeyy123 <at> gmail.com>
To: "bug-gnu-emacs <at> gnu.org" <bug-gnu-emacs <at> gnu.org>
Subject: 28.2; jsonrpc.el; Function jsonrpc-error's error code is not correct
Date: Thu, 27 Jul 2023 15:56:20 +0900
[Message part 1 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#64888; Package emacs. (Fri, 28 Jul 2023 06:58:02 GMT) Full text and rfc822 format available.

Message #8 received at 64888 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: YI YUE <includeyy123 <at> gmail.com>, João Távora
 <joaotavora <at> gmail.com>
Cc: 64888 <at> debbugs.gnu.org
Subject: Re: bug#64888: 28.2; jsonrpc.el;
 Function jsonrpc-error's error code is not correct
Date: Fri, 28 Jul 2023 09:57:56 +0300
> Date: Thu, 27 Jul 2023 15:56:20 +0900
> From: YI YUE <includeyy123 <at> gmail.com>
> 
> I noticed that in jsonrpc.el, the function `jsonrpc-error' will singal a
> `jsonrpc-error' error
> 
> with error code 32603, but in JSON-RPC 2.0 Specification[1], the error code is
> -32603

João, any comments?  It looks like a simple typo to me, or am I
missing something?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#64888; Package emacs. (Fri, 28 Jul 2023 08:23:02 GMT) Full text and rfc822 format available.

Message #11 received at 64888 <at> debbugs.gnu.org (full text, mbox):

From: João Távora <joaotavora <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 64888 <at> debbugs.gnu.org, YI YUE <includeyy123 <at> gmail.com>
Subject: Re: bug#64888: 28.2; jsonrpc.el; Function jsonrpc-error's error code
 is not correct
Date: Fri, 28 Jul 2023 09:24:45 +0100
On Fri, Jul 28, 2023 at 7:57 AM Eli Zaretskii <eliz <at> gnu.org> wrote:
>
> > Date: Thu, 27 Jul 2023 15:56:20 +0900
> > From: YI YUE <includeyy123 <at> gmail.com>
> >
> > I noticed that in jsonrpc.el, the function `jsonrpc-error' will singal a
> > `jsonrpc-error' error
> >
> > with error code 32603, but in JSON-RPC 2.0 Specification[1], the error code is
> > -32603
>
> João, any comments?  It looks like a simple typo to me, or am I
> missing something?

Yes, it's a typo and an outright bug, according to the docstring,
which is correct.

When an Elisp JSONRPC endpoint request handler explicitly signals an
error with the jsonrpc-error function, the mistaken recorded
code is  sent over the wire to the other endpoint.  When it signals
any other error (more common), the correct -32603 is sent.

So this erroneous code is not displayed to the user
(unless debug-on-error is on) nor is it something
that the jsonrpc.el client application can reasonably consume
and hypothetically need to be bug-compatible with.

However, other arbitrary JSONRPC endpoints (outside of Emacs)
may theoretically have grown some expectation of the bugged value
it they're only ever talking to jsonrpc.el backed endpoints.
But I've never seen this and I don't think this is too likely.

So I'd say we should probably fix this without too much worry.

João




Reply sent to João Távora <joaotavora <at> gmail.com>:
You have taken responsibility. (Sat, 29 Jul 2023 10:15:02 GMT) Full text and rfc822 format available.

Notification sent to YI YUE <includeyy123 <at> gmail.com>:
bug acknowledged by developer. (Sat, 29 Jul 2023 10:15:02 GMT) Full text and rfc822 format available.

Message #16 received at 64888-done <at> debbugs.gnu.org (full text, mbox):

From: João Távora <joaotavora <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>, 64888-done <at> debbugs.gnu.org
Cc: YI YUE <includeyy123 <at> gmail.com>
Subject: Re: bug#64888: 28.2; jsonrpc.el; Function jsonrpc-error's error code
 is not correct
Date: Sat, 29 Jul 2023 11:16:29 +0100
I've fixed this in master, commit 2af83f215ce83eda5a3eba21c352e6cd7435fbb1.

Closing.

On Fri, Jul 28, 2023 at 9:24 AM João Távora <joaotavora <at> gmail.com> wrote:
>
> On Fri, Jul 28, 2023 at 7:57 AM Eli Zaretskii <eliz <at> gnu.org> wrote:
> >
> > > Date: Thu, 27 Jul 2023 15:56:20 +0900
> > > From: YI YUE <includeyy123 <at> gmail.com>
> > >
> > > I noticed that in jsonrpc.el, the function `jsonrpc-error' will singal a
> > > `jsonrpc-error' error
> > >
> > > with error code 32603, but in JSON-RPC 2.0 Specification[1], the error code is
> > > -32603
> >
> > João, any comments?  It looks like a simple typo to me, or am I
> > missing something?
>
> Yes, it's a typo and an outright bug, according to the docstring,
> which is correct.
>
> When an Elisp JSONRPC endpoint request handler explicitly signals an
> error with the jsonrpc-error function, the mistaken recorded
> code is  sent over the wire to the other endpoint.  When it signals
> any other error (more common), the correct -32603 is sent.
>
> So this erroneous code is not displayed to the user
> (unless debug-on-error is on) nor is it something
> that the jsonrpc.el client application can reasonably consume
> and hypothetically need to be bug-compatible with.
>
> However, other arbitrary JSONRPC endpoints (outside of Emacs)
> may theoretically have grown some expectation of the bugged value
> it they're only ever talking to jsonrpc.el backed endpoints.
> But I've never seen this and I don't think this is too likely.
>
> So I'd say we should probably fix this without too much worry.
>
> João



-- 
João Távora




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 26 Aug 2023 11:24:10 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 294 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.