Vladimir Sementsov-Ogievskiy <vsement...@virtuozzo.com> writes: > 08.10.2019 12:39, Greg Kurz wrote: >> On Tue, 8 Oct 2019 08:41:08 +0000 >> Vladimir Sementsov-Ogievskiy <vsement...@virtuozzo.com> wrote: >> >>> 08.10.2019 10:30, Markus Armbruster wrote: >>>> Vladimir Sementsov-Ogievskiy <vsement...@virtuozzo.com> writes: >>>> >>>>> Hi all! >>>>> >>>>> Here is a proposal of auto propagation for local_err, to not call >>>>> error_propagate on every exit point, when we deal with local_err. >>>>> >>>>> There are also two issues with errp: >>>>> >>>>> 1. error_fatal & error_append_hint/error_prepend: user can't see this >>>>> additional info, because exit() happens in error_setg earlier than info >>>>> is added. [Reported by Greg Kurz] >>>> >>>> How is this series related to Greg's "[PATCH 00/17] Fix usage of >>>> error_append_hint()"? Do we need both? >>> >>> These series is a substitution for Greg's. Still, there are problems with >>> automation, which Greg pointed in 21/31, and I don't know what to do next. >>> >>> May be, just continue to review patches and fix them by hand. May be try to >>> improve automation... >>> >> >> The feeling I have after working on my series is that the lines that deal >> with errors are mixed up with the functional code in a variety of ways. >> That makes it very difficult if not impossible to come with code patterns >> suitable for a 100% automated solution IMHO. >> >> My questioning is more around the semantics of error_fatal actually. What >> does passing &error_fatal gives us over passing &local_err and calling >> error_report_err()+exit(), apart from breaking error_append_hint() and >> error_prepend() ? > > As I understand, the only benefit is one line instead of four:
Brevity matters when it comes to error handling. > func(..., &error_fatal); > > instead of > > func(..., &local_err); > if (local_err) { error_report_err(local_err); > exit(1); > } [...]