[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Any downside to condition-case-unless-debug?
From: |
Stefan Monnier |
Subject: |
Re: Any downside to condition-case-unless-debug? |
Date: |
Thu, 27 May 2021 19:22:10 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
> I feel like a lot of my debugging recently has involved various ways of
> working around `condition-case' and its swallowing of useful error
> information. Is there any reason not to prefer
> `condition-case-unless-debug' in new code?
IME, `condition-case-unless-debug' is used/useful mostly for
`condition-case` that catch "any error", most of which might be better
served by something like `with-demoted-errors`.
For those `condition-case` which catch one particular kind of error to
handle a particular expected situation (e.g. when catching `scan-error`
around a call to `forward-sexp`), `condition-case-unless-debug` rarely
makes sense.
Stefan