[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Avoid crash in `org-file-contents' in case of network failur
From: |
Ihor Radchenko |
Subject: |
Re: [PATCH] Avoid crash in `org-file-contents' in case of network failure |
Date: |
Wed, 22 Feb 2023 09:30:48 +0000 |
Damien Cassou <damien@cassou.me> 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 <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>