diff options
Diffstat (limited to 'libpqpp/error.cpp')
-rw-r--r-- | libpqpp/error.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/libpqpp/error.cpp b/libpqpp/error.cpp new file mode 100644 index 0000000..0886238 --- /dev/null +++ b/libpqpp/error.cpp @@ -0,0 +1,28 @@ +#include "error.h" +#include <string.h> + +PQ::Error::Error() : + msg(NULL) +{ +} + +PQ::Error::Error(const PQ::Error & e) : + msg(e.msg ? strdup(e.msg) : NULL) +{ +} + +PQ::Error::Error(const char * e) : + msg(e ? strdup(e) : NULL) +{ +} + +PQ::Error::~Error() throw() +{ +} + +const char * +PQ::Error::what() const throw() +{ + return msg ? msg : "No message"; +} + |