The current use of throw_on_error is verbose and error-prone. With careful design, we can craft a with_diagnostics completion token that grabs the diagnostics* argument from the initiation args and makes the function throw the adequate exception type.
The current use of
throw_on_error
is verbose and error-prone. With careful design, we can craft awith_diagnostics
completion token that grabs thediagnostics*
argument from the initiation args and makes the function throw the adequate exception type.