Exception types¶
This page lists the exception types thrown by BLACK in many situations. BLACK only ever throws exceptions of types listed in this page, or standard exception types thrown by the standard library.
-
class exception : public std::logic_error¶
Base class for all the exception types thrown by BLACK.
-
class bad_unreachable : public exception¶
Exception type thrown by
black_unreachablein case of failure.- Constructor:
-
bad_unreachable(const char *filename, size_t line)¶
- Parameters:
filename – the name of the file of the
black_unreachablecall.line – the line of the
black_unreachablecall.
-
bad_unreachable(const char *filename, size_t line)¶
- Members:
-
std::string_view filename() const¶
- Returns:
the name of the file of the
black_unreachablecall.
-
size_t line() const¶
- Returns:
the line of the
black_unreachablecall.
-
std::string_view filename() const¶
-
class bad_assert : public exception¶
Exception type thrown by
black_assertin case of failure.- Constructor:
-
bad_assert(const char *filename, size_t line, const char *expression)¶
- Parameters:
filename – the name of the file of the failed
black_assertcall.line – the line of the failed
black_assertcall.expression – a string representation of the asserted expression of the failed
black_assertcall.
-
bad_assert(const char *filename, size_t line, const char *expression)¶
- Members:
-
std::string_view filename() const¶
- Returns:
the name of the file of the failed
black_assertcall.
-
size_t line() const¶
- Returns:
the line of the failed
black_assertcall.
-
std::string_view expression() const¶
- Returns:
a string representation of the asserted expression of the failed
black_assertcall.
-
std::string_view filename() const¶
-
class bad_assumption : public bad_assert¶
Exception type thrown by
black_assumein case of failure.- Constructor:
-
bad_assumption(const char *function, const char *filename, size_t line, std::source_location const &loc, const char *expression, const char *message)¶
- Parameters:
function – the name of the function that contains the failed
black_assumecall.filename – the name of the file of the failed
black_assertcall.line – the line of the failed
black_assertcall.loc –
std::source_locationof the failed black_assume call.expression – a string representation of the asserted expression of the failed
black_assertcall.message – the message associated with the failed
black_assumecall.
-
bad_assumption(const char *function, const char *filename, size_t line, std::source_location const &loc, const char *expression, const char *message)¶
- Members:
-
std::string_view function() const¶
- Returns:
the name of the function that contains the failed
black_assumecall.
-
std::string_view message() const¶
- Returns:
the message associated with the failed
black_assumecall.
-
std::string_view function() const¶