Brush C++ API
A flexible interpretable machine learning framework
Toggle main menu visibility
Loading...
Searching...
No Matches
error.cpp
Go to the documentation of this file.
1
/* Brush
2
copyright 2020 William La Cava
3
license: GNU/GPL v3
4
*/
5
6
#include "
error.h
"
7
#include "fmt/format.h"
8
//#include "node/node.h"
9
//external includes
10
11
namespace
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
} }
error.h
Brush::Util
namespace containing various utility functions
Definition
error.cpp:11
Brush::Util::HandleErrorNoThrow
void HandleErrorNoThrow(string err, const char *file, int line)
prints error to stderr and returns
Definition
error.cpp:25
Brush::Util::HandleErrorThrow
void HandleErrorThrow(string err, const char *file, int line)
prints error and throws an exception
Definition
error.cpp:13
Brush
< nsga2 selection operator for getting the front
Definition
bandit.cpp:3
src
util
error.cpp
Generated by
1.17.0