[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC] Logically composable variant of errexit
From: |
Andreas Grünbacher |
Subject: |
Re: [RFC] Logically composable variant of errexit |
Date: |
Fri, 10 Oct 2014 11:36:59 +0200 |
2014-10-10 8:38 GMT+02:00 Dan Douglas <ormaaj@gmail.com>:
> I would still propose that a simple and powerful way to extend Bash with
> exception handling would be to extend the ERR trap by passing it some metadata
> about the type and location of the exception incurred so that it can be
> handled
> by user code. This proposal allows us to largely avoid having to answer the
> question of "when and where does it make sense for this to get triggered?" for
> the user.
>
> It might require a new type of trap that just fires on anything that returns
> false or fails so that the user handler can choose what to do about it in
> various contexts.
Well, currently, the ERR trap only triggers when errexit would
trigger, so another
type of trap would certainly be needed. I don't think it's reasonable
to expect from
users to use trigger tricks to get basic error handling working in a sane way,
though; this should be built in and trivial to activate.
Thanks,
Andreas