GNU bug report logs - #53762
Improve error message when during url retrieving network connection is lost

Previous Next

Package: emacs;

Reported by: emacsq <laszlomail <at> protonmail.com>

Date: Thu, 3 Feb 2022 19:32:02 UTC

Severity: wishlist

Tags: fixed

Fixed in version 29.1

Done: Robert Pluim <rpluim <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 53762 in the body.
You can then email your comments to 53762 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#53762; Package emacs. (Thu, 03 Feb 2022 19:32:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to emacsq <laszlomail <at> protonmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 03 Feb 2022 19:32:02 GMT) Full text and rfc822 format available.

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

From: emacsq <laszlomail <at> protonmail.com>
To: "Bug reports for GNU Emacs,
 the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
Subject: Improve error message when during url retrieving network connection
 is lost
Date: Thu, 03 Feb 2022 19:30:31 +0000
Sometimes when fetching an URL with url-retireve emacs
returns the error "Process <URL> not running"

This is the case when emacs tries to do an operation
on the process and finds the process is not running anymore.

In case of fetching an url it is presumably because of
the network connection is unexpectedly lost, so for network
processes returning an error message like "Network connection
closed unexpectedly" or similar is more informative for the
user than saying "Process X not running".





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#53762; Package emacs. (Fri, 04 Feb 2022 09:51:01 GMT) Full text and rfc822 format available.

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

From: Robert Pluim <rpluim <at> gmail.com>
To: 53762 <at> debbugs.gnu.org
Cc: emacsq <laszlomail <at> protonmail.com>
Subject: Re: bug#53762: Improve error message when during url retrieving
 network connection is lost
Date: Fri, 04 Feb 2022 10:50:41 +0100
>>>>> On Thu, 03 Feb 2022 19:30:31 +0000, emacsq via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org> said:

    emacsq> Sometimes when fetching an URL with url-retireve emacs
    emacsq> returns the error "Process <URL> not running"

    emacsq> This is the case when emacs tries to do an operation
    emacsq> on the process and finds the process is not running anymore.

    emacsq> In case of fetching an url it is presumably because of
    emacsq> the network connection is unexpectedly lost, so for network
    emacsq> processes returning an error message like "Network connection
    emacsq> closed unexpectedly" or similar is more informative for the
    emacsq> user than saying "Process X not running".

Does something like this do the trick? Iʼve not been able to get a
reliable test case for it yet.

diff --git a/src/process.c b/src/process.c
index 7c7f608284..18d4579dba 100644
--- a/src/process.c
+++ b/src/process.c
@@ -6424,7 +6424,7 @@ send_process (Lisp_Object proc, const char *buf, ptrdiff_t len,
   if (p->raw_status_new)
     update_status (p);
   if (! EQ (p->status, Qrun))
-    error ("Process %s not running", SDATA (p->name));
+    error ("Process %s %s", SDATA (p->name), SDATA (status_message (p)));
   if (p->outfd < 0)
     error ("Output file descriptor of %s is closed", SDATA (p->name));
 
@@ -7129,7 +7129,7 @@ DEFUN ("process-send-eof", Fprocess_send_eof, Sprocess_send_eof, 0, 1, 0,
   if (XPROCESS (proc)->raw_status_new)
     update_status (XPROCESS (proc));
   if (! EQ (XPROCESS (proc)->status, Qrun))
-    error ("Process %s not running", SDATA (XPROCESS (proc)->name));
+    error ("Process %s %s", SDATA (XPROCESS (proc)->name), SDATA (status_message (XPROCESS (proc))));
 
   if (coding && CODING_REQUIRE_FLUSHING (coding))
     {




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#53762; Package emacs. (Sat, 05 Feb 2022 06:58:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Robert Pluim <rpluim <at> gmail.com>
Cc: 53762 <at> debbugs.gnu.org, emacsq <laszlomail <at> protonmail.com>
Subject: Re: bug#53762: Improve error message when during url retrieving
 network connection is lost
Date: Sat, 05 Feb 2022 07:57:31 +0100
Robert Pluim <rpluim <at> gmail.com> writes:

> Does something like this do the trick? Iʼve not been able to get a
> reliable test case for it yet.

[...]

>    if (! EQ (p->status, Qrun))
> -    error ("Process %s not running", SDATA (p->name));
> +    error ("Process %s %s", SDATA (p->name), SDATA (status_message (p)));

I think that's probably an improvement over what we have now, but I
don't really have a good test case, either.  But perhaps "not running"
should be kept, and the status message just be appended?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#53762; Package emacs. (Mon, 07 Feb 2022 13:57:01 GMT) Full text and rfc822 format available.

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

From: Robert Pluim <rpluim <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 53762 <at> debbugs.gnu.org, emacsq <laszlomail <at> protonmail.com>
Subject: Re: bug#53762: Improve error message when during url retrieving
 network connection is lost
Date: Mon, 07 Feb 2022 14:56:50 +0100
>>>>> On Sat, 05 Feb 2022 07:57:31 +0100, Lars Ingebrigtsen <larsi <at> gnus.org> said:

    Lars> Robert Pluim <rpluim <at> gmail.com> writes:
    >> Does something like this do the trick? Iʼve not been able to get a
    >> reliable test case for it yet.

    Lars> [...]

    >> if (! EQ (p->status, Qrun))
    >> -    error ("Process %s not running", SDATA (p->name));
    >> +    error ("Process %s %s", SDATA (p->name), SDATA (status_message (p)));

    Lars> I think that's probably an improvement over what we have now, but I
    Lars> don't really have a good test case, either.  But perhaps "not running"
    Lars> should be kept, and the status message just be appended?

Sure, that can be done. Does the patch actually solve the problem,
emacsq?

Robert
-- 




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#53762; Package emacs. (Mon, 07 Feb 2022 16:50:02 GMT) Full text and rfc822 format available.

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

From: emacsq <laszlomail <at> protonmail.com>
To: Robert Pluim <rpluim <at> gmail.com>
Cc: 53762 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi <at> gnus.org>
Subject: Re: bug#53762: Improve error message when during url retrieving
 network connection is lost
Date: Mon, 07 Feb 2022 16:48:57 +0000
> Sure, that can be done. Does the patch actually solve the problem,
emacsq?

We have information if it's a network connection: if (NETCONN_P (proc))

So using that we can improve the message. Something like:

if (NETCONN_P (proc))
  "Network error: <process> <error message>"
else
  "Process <process> not running: <error message>"






Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#53762; Package emacs. (Tue, 08 Feb 2022 08:42:01 GMT) Full text and rfc822 format available.

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

From: Robert Pluim <rpluim <at> gmail.com>
To: emacsq <laszlomail <at> protonmail.com>
Cc: 53762 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi <at> gnus.org>
Subject: Re: bug#53762: Improve error message when during url retrieving
 network connection is lost
Date: Tue, 08 Feb 2022 09:40:53 +0100
>>>>> On Mon, 07 Feb 2022 16:48:57 +0000, emacsq via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org> said:

    >> Sure, that can be done. Does the patch actually solve the problem,
    emacsq> emacsq?

    emacsq> We have information if it's a network connection: if (NETCONN_P (proc))

    emacsq> So using that we can improve the message. Something like:

    emacsq> if (NETCONN_P (proc))
    emacsq>   "Network error: <process> <error message>"
    emacsq> else
    emacsq>   "Process <process> not running: <error message>"

`status_message' already produces different messages based on whether
itʼs a network connection, so I donʼt think thatʼs necessary.

Have you been able to try the original patch? I now realise that
youʼre on windows, which explains why you were seeing problems
originally.

Robert
-- 




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#53762; Package emacs. (Tue, 08 Feb 2022 21:51:01 GMT) Full text and rfc822 format available.

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

From: emacsq <laszlomail <at> protonmail.com>
To: Robert Pluim <rpluim <at> gmail.com>
Cc: 53762 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi <at> gnus.org>
Subject: Re: bug#53762: Improve error message when during url retrieving
 network connection is lost
Date: Tue, 08 Feb 2022 21:50:07 +0000
> `status_message' already produces different messages based on whether
itʼs a network connection, so I donʼt think thatʼs necessary.

Sounds good. I don't have a C compilation environment set up on
windows to try the patch, but it's an improvement over the current
message, so AFAIC this bug can be closed with this fix.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#53762; Package emacs. (Wed, 16 Mar 2022 18:00:02 GMT) Full text and rfc822 format available.

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

From: Robert Pluim <rpluim <at> gmail.com>
To: emacsq <laszlomail <at> protonmail.com>
Cc: 53762 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi <at> gnus.org>
Subject: Re: bug#53762: Improve error message when during url retrieving
 network connection is lost
Date: Wed, 16 Mar 2022 18:59:43 +0100
tags 53762 fixed
close 53762 29.1
quit

>>>>> On Tue, 08 Feb 2022 21:50:07 +0000, emacsq <laszlomail <at> protonmail.com> said:

    >> `status_message' already produces different messages based on whether
    emacsq> itʼs a network connection, so I donʼt think thatʼs necessary.

    emacsq> Sounds good. I don't have a C compilation environment set up on
    emacsq> windows to try the patch, but it's an improvement over the current
    emacsq> message, so AFAIC this bug can be closed with this fix.

Closing.
Committed as fa8c93ad9a




Added tag(s) fixed. Request was from Robert Pluim <rpluim <at> gmail.com> to control <at> debbugs.gnu.org. (Wed, 16 Mar 2022 18:00:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 29.1, send any further explanations to 53762 <at> debbugs.gnu.org and emacsq <laszlomail <at> protonmail.com> Request was from Robert Pluim <rpluim <at> gmail.com> to control <at> debbugs.gnu.org. (Wed, 16 Mar 2022 18:00:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 14 Apr 2022 11:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 68 days ago.

Previous Next


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