Feat C++ API
A feature engineering automation tool
error.h
Go to the documentation of this file.
1 /* FEAT
2 copyright 2017 William La Cava
3 license: GNU/GPL v3
4 */
5 
6 #ifndef ERROR_H
7 #define ERROR_H
8 
9 #include <string>
10 #include <iostream>
11 #include <stdexcept>
12 #include <signal.h>
13 
14 using namespace std;
15 
16 //#include "node/node.h"
17 //external includes
18 
19 namespace FT
20 {
21 namespace Util{
23 void ThrowRuntimeError(string err, const char *file, int line);
24 void ThrowInvalidArgument(string err, const char *file, int line);
25 void ThrowLengthError(string err, const char *file, int line);
26 
28 void Warn(string err, const char *file, int line);
29 
30 #define THROW_RUNTIME_ERROR( err ) (FT::Util::ThrowRuntimeError( err, __FILE__, __LINE__ ))
31 #define THROW_INVALID_ARGUMENT( err ) (FT::Util::ThrowInvalidArgument( err, __FILE__, __LINE__ ))
32 #define THROW_LENGTH_ERROR( err ) (FT::Util::ThrowLengthError( err, __FILE__, __LINE__ ))
33 #define WARN( err ) (FT::Util::Warn( err, __FILE__, __LINE__ ))
34 
36 void my_handler(int s);
37 
38 }
39 }
40 
41 #endif
void my_handler(int s)
handle signals (ctr-c etc.)
Definition: error.cc:43
void ThrowInvalidArgument(string err, const char *file, int line)
Definition: error.cc:22
void ThrowRuntimeError(string err, const char *file, int line)
prints error and throws an exception
Definition: error.cc:16
void ThrowLengthError(string err, const char *file, int line)
Definition: error.cc:28
void Warn(string err, const char *file, int line)
prints error to stderr and returns
Definition: error.cc:35
main Feat namespace
Definition: data.cc:13