From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id mI6QOeXg9WN/ggEAbAwnHQ (envelope-from ) for ; Wed, 22 Feb 2023 10:31:18 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id wEaNOeXg9WNOYAEAauVa8A (envelope-from ) for ; Wed, 22 Feb 2023 10:31:17 +0100 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 3812A7D2B for ; Wed, 22 Feb 2023 10:31:17 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pUlS4-0004Jt-Pb; Wed, 22 Feb 2023 04:30:17 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pUlS1-0004Jf-9c for emacs-orgmode@gnu.org; Wed, 22 Feb 2023 04:30:13 -0500 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pUlRy-00028b-RO for emacs-orgmode@gnu.org; Wed, 22 Feb 2023 04:30:13 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 632B1240774 for ; Wed, 22 Feb 2023 10:30:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1677058206; bh=ZF37sD34sC8W9Jq8a0zBAcPObXJFLa2uQ+pfV8kOomw=; h=From:To:Cc:Subject:Date:From; b=CJLEAy5Jjna1NO2v3b1nnyU8k8TZcHslvuYUGnt27p8FVCn5fN5kDvARjM9+35eAT 7mMavehC68sNV4vZzsCEn55cns9zy5lhaP9Nbevdr4CFR3EwxjoKBt/LGZeiEtuRBN y3H/c88ZJ4nrPg1d1xrqQpSi+HagzDH8hg2cJf4XM5wX+AUXGOWxHMmeB7XDG2XDFX eltDoHnHaCTJ07Ql666p69m6ICd3I+8o5C044Rs+ovpLsnju03seL3i0IPGIUhUd2U se8FIk1s8l3/EBwG/2BdhF3suCXHZ4reX/pEoFZ/nNycbhI4CTCTjhLYxFQTHl5hG2 hfwK7k0EeiU0g== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4PM9qK3KGrz6tmV; Wed, 22 Feb 2023 10:30:05 +0100 (CET) From: Ihor Radchenko To: Damien Cassou Cc: emacs-orgmode@gnu.org Subject: Re: [PATCH] Avoid crash in `org-file-contents' in case of network failure In-Reply-To: <87cz66278h.fsf@cassou.me> References: <87cz66278h.fsf@cassou.me> Date: Wed, 22 Feb 2023 09:30:48 +0000 Message-ID: <87y1oqcaif.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Seal: i=1; s=key1; d=yhetil.org; t=1677058277; a=rsa-sha256; cv=none; b=TtNsEYheQrtizMLD8UBb8snNt30hOUp3k6wiJDM+/VfkPE6bw9hDeHTHod8M0L9aV3pikC XKRhvETtqSYncBGTJJ1+EoIXBZyBJfE7SgXR0mEHDn1f36B3WmYTeh02X9Ar6dVLdiOTUS kA6z+wXCnAq1Dne50lSuovY42YfXL0br3FKRgEHdZQwXwCCwui2V2QVnQf3Dg1KvbbJEXd 9FhPc98u81p2jh16qrLNwgErv70+45MO3tqb5ctc/gzfRmjJlbg03KXXB8UMYmFoz/2ENL PnFMqQsB3uRMCDQeJguWTamOKKI0OuHfnO8FXO+WCRwOjIgzPcDgQkUGCOt82w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=CJLEAy5J; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=posteo.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1677058277; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=yl7+bAjNp05voQ9L3rru875G5wbR+i0pMlYOAdo+XCI=; b=dZQslx/wQSnNp3gtEqsrX5BP8X+ov+pHuX2uPIMD0cHTeb3OlkO+FAlH4wA9QNkNrukSYn bhy0mA6OM2Td1Fz2TzOt7V0Lq3O06Sp9UIxTW1UYeNzzdlE7kk2Zs9RHh/zUCr9z7kRzD0 FUKDjmZTdbakF14olAUb7rEXQf1AE5iy4f8DvORiqB2692Q1BI6YI4CzP2Ibt4ghjCtJgb pKnEWsf6zUU1k0OQmfRPglNfSJAyuiPiNzP6adm9s5zeSZeBVX8nSbCFh4QDK7NmxQ15VS jzL0UCxpsFpQBwBm9m3hD1fUF/G77nacqp2Kt1C012SmiorDnLxDNUNLC+OY4Q== Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=CJLEAy5J; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=posteo.net X-Spam-Score: -6.15 X-Migadu-Queue-Id: 3812A7D2B X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: -6.15 X-TUID: 0kD6NS4BlGWu Damien Cassou writes: > * lisp/org.el (org-file-contents): Wrap the > `url-retrieve-synchronously' call into a `condition-case' block to > avoid throwing an error when NOERROR is non-nil. Thanks for the patch! Few comments. > Subject: [PATCH] Avoid crash in `org-file-contents' in case of network failure > > * lisp/org.el (org-file-contents): Wrap the > `url-retrieve-synchronously' call into a `condition-case' block to > avoid throwing an error when NOERROR is non-nil. According to our records in https://orgmode.org/worg/contributors.html, you haven't signed FSF copyright agreement. May you add a TINYCHANGE cookie to the commit message as required by https://orgmode.org/worg/org-contribute.html#first-patch > + (error (if noerror > + (message "%s %S" (car error) (cdr error)) > + (signal (car error) (cdr error))))) I think that it will be a good idea to indicate in the `message' where the error is coming from. The error intercepted by this `condition-case' form will likely be a network error, and it may be unclear to the user which function is failing to make the connection. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at