Bond 0.9
C++ Bond Runtime Library API Documentation
Loading...
Searching...
No Matches
error.h File Reference

Runtime error detection macros that are always enabled. More...

#include "bond/conf.h"
#include "bond/private/error.h"

Detailed Description

Runtime error detection macros that are always enabled.

  • BOND_CHECK(condition), BOND_CHECK_MESSAGE(condition, message) and BOND_CHECK_FORMAT(condition, format, ...) throw a Bond::Exception when the condition is false.
  • BOND_ERROR(), BOND_ERROR_MESSAGE(message) and BOND_ERROR_FORMAT(format, ...) unconditionally throw a Bond::Exception.

These macros are intended for conditions that depend on program input, such as malformed CBO files, unresolved names or files that fail to open, and are never compiled out. For catching logic errors during development, use the debugging asserts in bond/systems/assert.h instead.

The default implementation can be replaced by defining USER_BOND_ERROR_HEADER. A replacement must define all six macros. Bond relies on them not returning when they report an error.