From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id +gYaANPFp2C1ZwAAgWs5BA (envelope-from ) for ; Fri, 21 May 2021 16:38:11 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id sBK2NtLFp2D5OgAAbx9fmQ (envelope-from ) for ; Fri, 21 May 2021 14:38:10 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 75465148E4 for ; Fri, 21 May 2021 16:38:10 +0200 (CEST) Received: from localhost ([::1]:54830 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lk6Hx-0004hZ-50 for larch@yhetil.org; Fri, 21 May 2021 10:38:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46496) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lk6Hq-0004h2-3K for bug-guix@gnu.org; Fri, 21 May 2021 10:38:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:54049) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lk6Hp-0006Ub-QW for bug-guix@gnu.org; Fri, 21 May 2021 10:38:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lk6Hp-0005rf-Nq for bug-guix@gnu.org; Fri, 21 May 2021 10:38:01 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#48561: "Daemon not running" exception when avahi-daemon is not running Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Fri, 21 May 2021 14:38:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48561 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Mathieu Othacehe Received: via spool by 48561-submit@debbugs.gnu.org id=B48561.162160787422529 (code B ref 48561); Fri, 21 May 2021 14:38:01 +0000 Received: (at 48561) by debbugs.gnu.org; 21 May 2021 14:37:54 +0000 Received: from localhost ([127.0.0.1]:37362 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lk6Hi-0005rI-Jh for submit@debbugs.gnu.org; Fri, 21 May 2021 10:37:54 -0400 Received: from baptiste.telenet-ops.be ([195.130.132.51]:34136) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lk6He-0005r8-Ks for 48561@debbugs.gnu.org; Fri, 21 May 2021 10:37:53 -0400 Received: from ptr-bvsjgyjmffd7q9timvx.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:aaf1:9810:a0b8:a55d]) by baptiste.telenet-ops.be with bizsmtp id 7Sdo2500h0mfAB401SdonL; Fri, 21 May 2021 16:37:49 +0200 Message-ID: From: Maxime Devos Date: Fri, 21 May 2021 16:37:48 +0200 In-Reply-To: <87im3cqkzn.fsf@gnu.org> References: <2d3636af080e6bcddc6ba94dc162260c0e73ed54.camel@telenet.be> <87im3cqkzn.fsf@gnu.org> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-8iKBrrvKGqXf1vzSaoGo" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1621607869; bh=Yb6YQ7i5zkUJpsNmarXkuOySqC4RoBi9+gS+1VAGJGU=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=vC9+vCL1UCbTRYk7YhwH+JyXga7/pSopGURv/ZL4mMTTXLG4zNKX7oi6jAUpmPhXj 0KDPaGJJOLT2H0KzhsSgkfxV6y9uTqACoxfzJ4+cJlCgxylJeigJ4CNHaWDXEwFyIv Pt+MCH03BMn15YLQc4ZUKEXGhf10jSXVur1C9xNYTw8L2TRB2I5VL9fVzz4ADlcK8S ZDZwriUjP6mjGlu/rurbWCVUkGy2NDCJMYp5v5ic6aaCIMGwg40PA9kE5+itCayIBM 0LLevDOMXe5/OxEuC3vJBhQUZZ4w7pBEh8Jc4IOaPuzGiRe1MXEbPk5at16UnutUOk zg0XFBya7P3+g== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 48561@debbugs.gnu.org Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1621607890; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=Yb6YQ7i5zkUJpsNmarXkuOySqC4RoBi9+gS+1VAGJGU=; b=IasE6k83gvp8opQqSzzoYo+doT8Ap1Y8dpYz8F91jq8NsgMc7qboeg6Gjd4YUUy2XWIS0v hQs8+plREVWebW1UEMyNoPyXDtXtf1Ln8aM1qsgbGqT+g9qWOb0Ll3rAM2snYlamkuaYjC OxTzikVeCuY6rYGp2NqsT+CyEZkBak3ucJ3vj18tKDAG3LxEgj+rnz8s5kPTACZixVGV2X hGnUGbYqi2B4/0eW+0SkUp/sOOQU2xHftUWOX5c0EBFHM03iVYzKgbxoJNcYpWRBepN9ux 5KxQE3IQj8eV07ZKBbS2gfezBh6ajx/d7Ih2v9zEKp3CSKkOT3cHE+MHbZPqqg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1621607890; a=rsa-sha256; cv=none; b=jLFFTY8C2vq37w6wgZH6s8Z/wwvI3s1hj6QAZSxuu0pEZUl/izlJgcO36QtAZIEzpUahoF kSLTLqwDLaQCGQRKKJ9HkJvu0lxB+zG3HGYXecdXeew2HnRIEV3S4gthexqC41ufVUJxFq BPhT5RlXl8tZr62/l4gEPNkEaMlU0K9a3AbV7lxiKKG35dNh1a7bI/d1H8B0TeDONS/hoH PPkB0D/WBUgSepDeZkvir7h6Xbvc+7nX7/uCeKn5fozib4kC7HyvLt4RGAuqosjyB2HG28 J3KZ83Kb4elLJV/iAUx1Qhy+OCQnKjWFZPlaljQ1iqrkhEOPAhE4unZJrGNRUw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r21 header.b=vC9+vCL1; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Spam-Score: -3.44 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r21 header.b=vC9+vCL1; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Queue-Id: 75465148E4 X-Spam-Score: -3.44 X-Migadu-Scanner: scn0.migadu.com X-TUID: bWo+mgzPFxVY --=-8iKBrrvKGqXf1vzSaoGo Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Mathieu, Mathieu Othacehe schreef op vr 21-05-2021 om 15:23 [+0200]: > + (catch 'avahi-error > + (lambda () > + (avahi-browse-service-thread service-proc > + #:types %services)) > + (lambda (key err function . _) > + (cond > + ((eq? err error/no-daemon) > + (warning (G_ "Avahi daemon is not running, \ > +cannot auto-discover substitutes servers.~%")))) > + (exit 1))))))) Shouldn't this code print an an error message when err is something other than error/no-daemon? You can use error->string. Two examples from (guile-avahi)Error handling: 2.4 Error Handling =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Avahi errors are implemented as Scheme exceptions (*note exceptions in Guile: (guile)Exceptions.). Each time a Avahi function returns an error, an exception with key 'avahi-error' is raised. The additional arguments that are thrown include an error code and the name of the Avahi procedure that raised the exception. The error code is pretty much like an enumerate value: it is one of the 'error/' variables exported by the '(avahi)' module (*note Enumerates and Constants::). Exceptions can be turned into error messages using the 'error->string' procedure. The following examples illustrates how Avahi exceptions can be handled: (let ((poll (make-simple-poll))) ;; ;; ... ;; (catch 'avahi-error (lambda () (run-simple-poll (simple-poll poll))) (lambda (key err function . currently-unused) (format (current-error-port) "an Avahi error was raised by `~a': ~a~%" function (error->string err))))) Again, error values can be compared using 'eq?': ;; `avahi-error' handler. (lambda (key err function . currently-unused) (if (eq? err error/no-daemon) (format (current-error-port) "~a: the Avahi daemon is not running~%" function))) Otherwise LGTM, but I haven't tested. Greetings, Maxime. --=-8iKBrrvKGqXf1vzSaoGo Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYKfFvBccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7iObAQCoPrIebwJ6Om7X7JkhRUmyGgjG o8fwjpdo5o0iRUR29AEA7Kqfv3dCjFEM7H54h/9R5ckO1Shy6dwOq1nJh/4cMww= =ignq -----END PGP SIGNATURE----- --=-8iKBrrvKGqXf1vzSaoGo--