summaryrefslogtreecommitdiff
path: root/src/main/exceptions.cc
blob: 577a079d48406431c49f02606fc37ee6c0ad1be4 (plain) (blame)
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
/*
 * exceptions.cc
 *
 *  Created on: Apr 17, 2011
 *      Author: jakob
 */

#include <sstream>
#include "exceptions.h"

namespace vhc {

Exception::Exception(): message("") {};

Exception::Exception(std::string message): message(message) {};

Exception::~Exception() {};

std::string Exception::getExceptionType() const {return "Exception";}

std::string Exception::getMessage() const {return message;}

std::string Exception::toString() const {
	std::stringstream s;
	s << getExceptionType() << ": " << getMessage();
	return s.str();
}


IllegalArgumentException::IllegalArgumentException(): Exception() {};
IllegalArgumentException::IllegalArgumentException(std::string message): Exception(message) {};

std::string IllegalArgumentException::getExceptionType() const {return "IllegalArgumentException";}



UnsupportedOperationException::UnsupportedOperationException(): Exception() {};
UnsupportedOperationException::UnsupportedOperationException(std::string message): Exception(message) {};

std::string UnsupportedOperationException::getExceptionType() const {return "UnsupportedOperationException";}

}