Huggle  build:^490^dce1e5c
 All Classes Namespaces Functions Variables Enumerations Enumerator Pages
exception.cpp
1 //This program is free software: you can redistribute it and/or modify
2 //it under the terms of the GNU General Public License as published by
3 //the Free Software Foundation, either version 3 of the License, or
4 //(at your option) any later version.
5 
6 //This program is distributed in the hope that it will be useful,
7 //but WITHOUT ANY WARRANTY; without even the implied warranty of
8 //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 //GNU General Public License for more details.
10 
11 #include "exception.hpp"
12 
13 using namespace Huggle;
14 
15 Exception::Exception(QString Text, bool __IsRecoverable)
16 {
17  std::cerr << "FATAL Exception thrown: " + Text.toStdString() << std::endl;
18  this->Message = Text;
19  this->ErrorCode = 2;
20  this->Source = "None";
21  this->_IsRecoverable = __IsRecoverable;
22 }
23 
24 Exception::Exception(QString Text, QString _Source, bool __IsRecoverable)
25 {
26  std::cerr << "FATAL Exception thrown: " + Text.toStdString() << std::endl;
27  this->Source = _Source;
28  this->Message = Text;
29  this->ErrorCode = 2;
30  this->_IsRecoverable = __IsRecoverable;
31 }
32 
33 bool Exception::IsRecoverable()
34 {
35  return _IsRecoverable;
36 }
This is similar to query, just it&#39;s more simple, you can use it to deliver messages to users...
Definition: message.hpp:26
int ErrorCode
Error code.
Definition: exception.hpp:24
Exception(QString Text, bool __IsRecoverable=true)
ctor
Definition: exception.cpp:15