Skip to content

Commit 48f27f5

Browse files
committed
modify exception
1 parent 65aa10b commit 48f27f5

File tree

5 files changed

+15
-22
lines changed

5 files changed

+15
-22
lines changed

Exception/MailClientException.h

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,12 @@ class MailClientException: public exception
99
{
1010
public:
1111
MailClientException() {}
12-
MailClientException(string exc): exception(exc.c_str()) {}
13-
virtual ~MailClientException() {
14-
exception::~exception();
15-
}
16-
const char* what() const override{
17-
string tmp = exception::what();
18-
tmp = "MailClientException: " + tmp;
19-
return tmp.c_str();
20-
}
12+
MailClientException(const string& exc): exception(exc.c_str()) {}
13+
MailClientException(const MailClientException& mce): exception(mce) {}
14+
virtual ~MailClientException() throw() = 0;
15+
virtual const char* what() const = 0;
2116
};
2217

18+
MailClientException::~exception() {}
2319

2420
#endif // MAILCLIENTEXCEPTION_H

Exception/MailGenerationException.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@ class MailGenerationException: public MailClientException
66
{
77
public:
88
MailGenerationException() {}
9-
MailGenerationException(string exc): MailClientException(exc.c_str()) {}
10-
virtual ~MailGenerationException() {
11-
MailClientException::~MailClientException();
12-
}
9+
MailGenerationException(const string& exc): MailClientException(exc.c_str()) {}
10+
MailClientException(const MailClientException& mce): MailClientException(mce) {}
11+
~MailGenerationException() override {}
1312
const char* what() const override{
1413
string tmp = MailClientException::what();
1514
tmp = "MailGenerationException: " + tmp;

Exception/MailReceiveException.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@ class MailReceiveException: public MailClientException
66
{
77
public:
88
MailReceiveException() {}
9-
MailReceiveException(string exc): MailClientException(exc.c_str()) {}
10-
virtual ~MailReceiveException() {
11-
MailClientException::~MailClientException();
12-
}
9+
MailReceiveException(const string& exc): MailClientException(exc.c_str()) {}
10+
MailClientException(const MailClientException& mce): MailClientException(mce) {}
11+
~MailReceiveException() override {}
1312
const char* what() const override{
1413
string tmp = MailClientException::what();
1514
tmp = "MailGenerationException: " + tmp;

Exception/MailSendException.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@ class MailSendException: public MailClientException
66
{
77
public:
88
MailSendException() {}
9-
MailSendException(string exc): MailClientException(exc.c_str()) {}
10-
virtual ~MailSendException() {
11-
MailClientException::~MailClientException();
12-
}
9+
MailSendException(const string& exc): MailClientException(exc.c_str()) {}
10+
MailClientException(const MailClientException& mce): MailClientException(mce) {}
11+
~MailSendException() override {}
1312
const char* what() const override{
1413
string tmp = MailClientException::what();
1514
tmp = "MailGenerationException: " + tmp;

MicroMailClient.pro.user

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!DOCTYPE QtCreatorProject>
3-
<!-- Written by QtCreator 3.6.1, 2016-05-27T20:11:28. -->
3+
<!-- Written by QtCreator 3.6.1, 2016-05-27T22:41:34. -->
44
<qtcreator>
55
<data>
66
<variable>EnvironmentId</variable>

0 commit comments

Comments
 (0)