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.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: João Távora <joaotavora <at> gmail.com>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#64888: closed (28.2; jsonrpc.el; Function jsonrpc-error's
 error code is not correct)
Date: Sat, 29 Jul 2023 10:15:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Sat, 29 Jul 2023 11:16:29 +0100
with message-id <CALDnm50c4731Z_NYTvNBFR-CzXRzM5CDJD-jrrYe97T6grJQ0A <at> mail.gmail.com>
and subject line Re: bug#64888: 28.2; jsonrpc.el; Function jsonrpc-error's error code is not correct
has caused the debbugs.gnu.org bug report #64888,
regarding 28.2; jsonrpc.el; Function jsonrpc-error's error code is not correct
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
64888: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=64888
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
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 3 (text/html, inline)]
[Message part 4 (message/rfc822, inline)]
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


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

Previous Next


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