Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for a snapshot of the develop branch, built from commit d01184f945.
PrevUpHomeNext

throw_on_error

(Legacy) Throws an exception in case of error, including diagnostic information.

Synopsis

Defined in header <boost/mysql/throw_on_error.hpp>

void
throw_on_error(
    error_code err,
    const diagnostics& diag = {});
Description

If err indicates a failure (err.failed() == true), throws an exception that derives from error_with_diagnostics. The exception will make diag available in error_with_diagnostics::get_diagnostics.

Legacy

The introduction of with_diagnostics obsoletes almost all uses of this function. New code should attempt to use with_diagnostics instead of manually checking for errors.

Convenience header <boost/mysql.hpp>


PrevUpHomeNext