unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* trapping process filter error in a thread
@ 2022-03-22 14:01 Thien-Thi Nguyen
  2022-03-22 19:28 ` Emanuel Berg via Users list for the GNU Emacs text editor
  2022-03-24  2:33 ` Felix Dietrich
  0 siblings, 2 replies; 7+ messages in thread
From: Thien-Thi Nguyen @ 2022-03-22 14:01 UTC (permalink / raw)
  To: help-gnu-emacs


[-- Attachment #1.1: Type: text/plain, Size: 399 bytes --]


I'm in the process of writing a dead-link checker and would like
to use Emacs' threads and ‘url-http’ funcs.  I've run into a
problem w/ GNU Emacs 27.1 (Debian), however: When there is a TLS
problem, i am unable to trap the process filter error.  It seems
‘condition-case’ is not the right tool for the job.

Attached here is a fragment that encapsulates the heart of the
problem:

[-- Attachment #1.2: bad.el --]
[-- Type: application/emacs-lisp, Size: 514 bytes --]

[-- Attachment #1.3: Type: text/plain, Size: 92 bytes --]


and a *compilation* buffer capture that shows how the process
filter error is not trapped:

[-- Attachment #1.4: bad.out --]
[-- Type: application/octet-stream, Size: 495 bytes --]

-*- mode: compilation; default-directory: "/tmp/" -*-
Compilation started at Tue Mar 22 09:42:14

for url in https://www.gnu.org/ https://www.gnu.org/WRONG http://www.oecd.org/pisa/test/ ; do echo ; echo url: $url ; emacs -q -Q --batch -l bad.el $url ; done

url: https://www.gnu.org/
"ok"

url: https://www.gnu.org/WRONG
"dead"

url: http://www.oecd.org/pisa/test/
error in process filter: Process www.oecd.org<1> not running

Compilation exited abnormally with code 255 at Tue Mar 22 09:42:17

[-- Attachment #1.5: Type: text/plain, Size: 879 bytes --]


My questions are:

(a) Can anyone else reproduce this on their Emacs?
    (Obviously your Emacs has to be built w/ thread support.)

(b) Does the same code work in different versions of Emacs?

(c) Is there a recommended way to trap process filter errors
    for a noninteractive (perhaps batch) session?

(d) Is there a more idiomatic way to work w/ threads and
    ‘url-http’ (or async network connections, in general)?

Thank-you for any insight into this corner of Emacs Lisp!

-- 
Thien-Thi Nguyen -----------------------------------------------
 (defun responsep (query)               ; (2022) Software Libero
   (pcase (context query)               ;       = Dissenso Etico
     (`(technical ,ml) (correctp ml))
     ...))                              748E A0E8 1CB8 A748 9BFA
--------------------------------------- 6CE4 6703 2224 4C80 7502


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 219 bytes --]

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

end of thread, other threads:[~2022-04-10  8:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-22 14:01 trapping process filter error in a thread Thien-Thi Nguyen
2022-03-22 19:28 ` Emanuel Berg via Users list for the GNU Emacs text editor
2022-04-02 23:54   ` Thien-Thi Nguyen
2022-04-03  0:50     ` Emanuel Berg via Users list for the GNU Emacs text editor
2022-03-24  2:33 ` Felix Dietrich
2022-04-03  0:07   ` Thien-Thi Nguyen
2022-04-10  8:58     ` Felix Dietrich

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