CHECK_NONFATAL

Identity function. Throw a NonFatalCheckError when the condition evaluates to false

Synopsis

Declared in <util/check.h>

#define CHECK_NONFATAL(condition)

Description

This should only be used

  • where the condition is assumed to be true, not for error handling or validating user input

  • where a failure to fulfill the condition is recoverable and does not abort the program

For example in RPC code, where it is undesirable to crash the whole program, this can be generally used to replace asserts or recoverable logic errors. A NonFatalCheckError in RPC code is caught and passed as a string to the RPC caller, which can then report the issue to the developers.

Parameters

NameDescription
conditionThe expression that is assumed to be true.