From 3a7e2b9a7bde4682f2273022e9d2ddecd7e5e3b8 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Tue, 29 Dec 2015 02:42:43 +0000 Subject: Reshuffle and add new exceptions --- libsqlitepp/sqlite-error.cpp | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) (limited to 'libsqlitepp/sqlite-error.cpp') diff --git a/libsqlitepp/sqlite-error.cpp b/libsqlitepp/sqlite-error.cpp index a0758ef..03ffac4 100644 --- a/libsqlitepp/sqlite-error.cpp +++ b/libsqlitepp/sqlite-error.cpp @@ -1,29 +1,14 @@ #include "sqlite-error.h" #include -SQLite::Error::Error() : - msg(NULL) +SQLite::Error::Error(sqlite3 * db) : + msg(sqlite3_errmsg(db)) { } -SQLite::Error::Error(const SQLite::Error & e) : - msg(e.msg ? strdup(e.msg) : NULL) +std::string +SQLite::Error::message() const throw() { -} - -SQLite::Error::Error(const char * e) : - msg(e ? strdup(e) : NULL) -{ -} - -SQLite::Error::~Error() throw() -{ - free(msg); -} - -const char * -SQLite::Error::what() const throw() -{ - return msg ? msg : "No message"; + return msg; } -- cgit v1.2.3