unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#64888: 28.2; jsonrpc.el; Function jsonrpc-error's error code is not correct
@ 2023-07-27  6:56 YI YUE
  2023-07-28  6:57 ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: YI YUE @ 2023-07-27  6:56 UTC (permalink / raw)
  To: 64888

[-- Attachment #1: Type: text/html, Size: 2253 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#64888: 28.2; jsonrpc.el; Function jsonrpc-error's error code is not correct
  2023-07-27  6:56 bug#64888: 28.2; jsonrpc.el; Function jsonrpc-error's error code is not correct YI YUE
@ 2023-07-28  6:57 ` Eli Zaretskii
  2023-07-28  8:24   ` João Távora
  0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2023-07-28  6:57 UTC (permalink / raw)
  To: YI YUE, João Távora; +Cc: 64888

> Date: Thu, 27 Jul 2023 15:56:20 +0900
> From: YI YUE <includeyy123@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?





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#64888: 28.2; jsonrpc.el; Function jsonrpc-error's error code is not correct
  2023-07-28  6:57 ` Eli Zaretskii
@ 2023-07-28  8:24   ` João Távora
  2023-07-29 10:16     ` João Távora
  0 siblings, 1 reply; 4+ messages in thread
From: João Távora @ 2023-07-28  8:24 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 64888, YI YUE

On Fri, Jul 28, 2023 at 7:57 AM Eli Zaretskii <eliz@gnu.org> wrote:
>
> > Date: Thu, 27 Jul 2023 15:56:20 +0900
> > From: YI YUE <includeyy123@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





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#64888: 28.2; jsonrpc.el; Function jsonrpc-error's error code is not correct
  2023-07-28  8:24   ` João Távora
@ 2023-07-29 10:16     ` João Távora
  0 siblings, 0 replies; 4+ messages in thread
From: João Távora @ 2023-07-29 10:16 UTC (permalink / raw)
  To: Eli Zaretskii, 64888-done; +Cc: YI YUE

I've fixed this in master, commit 2af83f215ce83eda5a3eba21c352e6cd7435fbb1.

Closing.

On Fri, Jul 28, 2023 at 9:24 AM João Távora <joaotavora@gmail.com> wrote:
>
> On Fri, Jul 28, 2023 at 7:57 AM Eli Zaretskii <eliz@gnu.org> wrote:
> >
> > > Date: Thu, 27 Jul 2023 15:56:20 +0900
> > > From: YI YUE <includeyy123@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





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-07-29 10:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-27  6:56 bug#64888: 28.2; jsonrpc.el; Function jsonrpc-error's error code is not correct YI YUE
2023-07-28  6:57 ` Eli Zaretskii
2023-07-28  8:24   ` João Távora
2023-07-29 10:16     ` João Távora

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).