unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Greg Minshall <minshall@umich.edu>
To: 72652@debbugs.gnu.org
Subject: bug#72652: sentinel
Date: Fri, 16 Aug 2024 09:11:00 +0300	[thread overview]
Message-ID: <507460.1723788660@archlinux> (raw)
In-Reply-To: <504501.1723782848@archlinux>

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...)





  reply	other threads:[~2024-08-16  6:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-16  4:34 bug#72652: 31.0.50; url-retrieve on non-existent domain gives no indication of error Greg Minshall
2024-08-16  6:11 ` Greg Minshall [this message]
2024-08-16  7:43 ` Eli Zaretskii
2024-08-16 19:39   ` Greg Minshall
2024-08-17  5:50     ` Eli Zaretskii
2024-08-17 12:54       ` Greg Minshall
2024-09-13  1:50         ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=507460.1723788660@archlinux \
    --to=minshall@umich.edu \
    --cc=72652@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).