Brush C++ API
A flexible interpretable machine learning framework
Loading...
Searching...
No Matches
error.cpp
Go to the documentation of this file.
1/* Brush
2copyright 2020 William La Cava
3license: GNU/GPL v3
4*/
5
6#include "error.h"
7#include "fmt/core.h"
8//#include "node/node.h"
9//external includes
10
11namespace Brush{ namespace Util{
13 void HandleErrorThrow(string err, const char *file, int line )
14 {
15 fmt::print(stderr, "FATAL ERROR {}:{}: {}\n", file, line, err);
16
17 // when called with no arguments, will call terminate(), which
18 // throws a std::terminate_handler (and can't be handled in GTEST).
19 // Here we throw a runtime_error with same information printed on
20 // screen.
21 throw std::runtime_error(fmt::format("FATAL ERROR {}:{}: {}\n", file, line, err));
22 }
23
25 void HandleErrorNoThrow(string err, const char *file, int line )
26 {
27 fmt::print(stderr, "WARNING {}:{}: {}\n", file, line, err);
28 }
29} }
30
void bind_engine(py::module &m, string name)
void HandleErrorNoThrow(string err, const char *file, int line)
prints error to stderr and returns
Definition error.cpp:25
void HandleErrorThrow(string err, const char *file, int line)
prints error and throws an exception
Definition error.cpp:13
< nsga2 selection operator for getting the front
Definition data.cpp:12