GNU bug report logs - #72652
31.0.50; url-retrieve on non-existent domain gives no indication of error

Previous Next

Package: emacs;

Reported by: Greg Minshall <minshall <at> umich.edu>

Date: Fri, 16 Aug 2024 04:38:01 UTC

Severity: normal

Found in version 31.0.50

Full log


View this message in rfc822 format

From: Greg Minshall <minshall <at> umich.edu>
To: 72652 <at> debbugs.gnu.org
Subject: bug#72652: sentinel
Date: Fri, 16 Aug 2024 09:11:00 +0300
i guess one can get some notification from a sentinel, though finding
the process itself is a bit kludgy:
````
(defun msg-me (process event)
  (princ
   (format "Process: %s had the event '%s'" process event)))

(let ((uproc (url-retrieve "https://y.example.com/index.html"
                           (lambda (x) (message "callback called: %s" x)))))
  (with-current-buffer uproc
    (set-process-sentinel url-http-process 'msg-me)))
````

gives output
````
Contacting host: y.example.com:443
Process: example.com had the event 'connection broken by remote peer
'
````

the message ("broken by remote peer") isn't as helpful as a "host does
not exist" message might be.

i guess to distinguish a name lookup failure, one could then (or before)
use, e.g., `dns-query-asynchronous`:

````
(dns-query-asynchronous
    "x.example.com"
    (lambda (x) (message "dns callback: %s" x)))
````

gives
````
dns callback: nil
````

(hope this formatting comes through reasonably...)




This bug report was last modified 277 days ago.

Previous Next


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