Re: What an error message must do

Emil Dotchevski via Boost <[email protected]> Fri, 26 Jun 2026 04:37:39 -0400
Newsgroups gmane.comp.lib.boost.devel
Message-ID <CAN5fK5FEjzCGWx+mj=2HZ5bHaXOt=ZSM4iDCxo0Gw_OpHJY=Gw@mail.gmail.com>
On Fri, Jun 26, 2026 at 3:11 AM Rainer Deyke via Boost <
[email protected]> wrote:

> On 6/25/26 23:16, Emil Dotchevski via Boost wrote:
> > Look at Boost LEAF, it lets you communicate arbitrary context with any
> > error, with or without exceptions.
> >
> > You can associate arbitrary context with any failure, the error objects
> are
> > communicated with type safety. At an error handling scope you have the
> > option to format a user-friendly message based on the available data, or
> an
> > automatic developer-friendly message, or to serialize everything into a
> > machine-readable format (nlohmann and Boost.JSON are directly supported,
> > but the serialization API is extensible.)
>
> A word of warning about LEAF: it uses thread-local storage in a way that
> is incompatible with thread-jumping code


Yes, when using LEAF, jumping between threads requires that the error
objects are collected and later released in the error handling thread. Just
like std::exception_ptr can capture an exception object, leaf::result can
capture any number of error objects (plus a C++ exception, if present).
_______________________________________________
Boost mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://lists.boost.org/mailman3/lists/boost.lists.boost.org/
Archived at: https://lists.boost.org/archives/list/[email protected]/message/Y3SC24IDNBQAJD727BLUFX7OLZXGA5QE/