summaryrefslogtreecommitdiff
path: root/libmysqlpp/error.cpp
blob: 2b9b4188eeb661c25c17d4a19658ab182e7e237d (plain)
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
#include "error.h"
#include <string.h>

MySQL::Error::Error() :
	msg(NULL)
{
}

MySQL::Error::Error(const MySQL::Error & e) :
	msg(e.msg ? strdup(e.msg) : NULL)
{
}

MySQL::Error::Error(const char * e) :
	msg(e ? strdup(e) : NULL)
{
}

MySQL::Error::~Error() throw()
{
	free(msg);
}

const char *
MySQL::Error::what() const throw()
{
	return msg ? msg : "No message";
}