Biorbd Release_1.13.0
Loading...
Searching...
No Matches
Error.cpp
1#define BIORBD_API_EXPORTS
2#include "Utils/Error.h"
3
4using namespace BIORBD_NAMESPACE;
5
6void utils::Error::raise(const utils::String& message) {
7 throw std::runtime_error(message);
8}
9
10void utils::Error::check(bool cond, const utils::String& message) {
11 if (!cond) {
12 throw std::runtime_error(message);
13 }
14}
15
16void utils::Error::warning(bool cond, const utils::String& message) {
17 if (!cond) {
18 std::cout << "Warning: " << message << std::endl;
19 }
20}
static void raise(const String &message)
Throw an error message.
Definition Error.cpp:6
static void warning(bool cond, const String &message)
Non-blocking assert that displays the error message if false.
Definition Error.cpp:16
static void check(bool cond, const String &message)
Assert that raises the error message if false.
Definition Error.cpp:10
Wrapper around the std::string class with augmented functionality.
Definition String.h:18