-
Notifications
You must be signed in to change notification settings - Fork 0
/
Error.cpp
43 lines (35 loc) · 972 Bytes
/
Error.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include "error.hpp"
void GeneralErrorHandler::Throw(unsigned where) const
{
Throw(where, default_err_code);
}
void GeneralErrorHandler::Throw(unsigned where, GenErrCode what) const
{
throw GeneralError(where, what, my_name());
}
void GeneralErrorHandler::Throw(GeneralError gen_err) const
{
throw gen_err;
}
void GeneralErrorHandler::Post(unsigned where) const
{
Post(where, default_err_code);
}
void GeneralErrorHandler::Post(unsigned where, GenErrCode what) const
{
if (external_err_ptr != nullptr)
external_err_ptr->GeneralError::GeneralError(where, what, my_name());
}
void GeneralErrorHandler::OnError(unsigned where)
{
OnError(where, default_err_code);
}
void GeneralErrorHandler::OnError(unsigned where, GenErrCode what)
{
// Default behavior - do nothing
// If a derived class uses this member it should redefine it
}
const char* GeneralErrorHandler::my_name() const
{
return typeid(*this).name();
}