Line | |
---|
1 | #include "Error.h" |
---|
2 | |
---|
3 | namespace orxonox |
---|
4 | { |
---|
5 | Error::Error() |
---|
6 | { |
---|
7 | Error(0,""); |
---|
8 | } |
---|
9 | |
---|
10 | Error::Error(std::string errorMsg, int errorCode) |
---|
11 | { |
---|
12 | Error(errorCode, errorMsg); |
---|
13 | } |
---|
14 | |
---|
15 | Error::Error(int errorCode, std::string errorMsg) |
---|
16 | { |
---|
17 | std::cout << "############################ "<< std::endl |
---|
18 | << "# Error "<<errorCode<< " #"<< std::endl |
---|
19 | << "############################ "<< std::endl |
---|
20 | << "An error occured in Orxonox: "<< std::endl; |
---|
21 | |
---|
22 | if (errorMsg=="") |
---|
23 | { |
---|
24 | switch (errorCode) |
---|
25 | { |
---|
26 | case 1: |
---|
27 | errorMsg = "Some error!"; |
---|
28 | break; |
---|
29 | default: |
---|
30 | errorMsg = "Unknown error!"; |
---|
31 | } |
---|
32 | } |
---|
33 | std::cout << errorMsg << std::endl<< std::endl; |
---|
34 | } |
---|
35 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.