diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2015-12-29 02:42:43 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2015-12-29 06:00:07 +0000 |
commit | 3a7e2b9a7bde4682f2273022e9d2ddecd7e5e3b8 (patch) | |
tree | d5dc58209bd8fa28047c54a11c09bc64505d5354 /libsqlitepp/sqlite-error.cpp | |
parent | Remove rebind (diff) | |
download | libdbpp-sqlite-3a7e2b9a7bde4682f2273022e9d2ddecd7e5e3b8.tar.bz2 libdbpp-sqlite-3a7e2b9a7bde4682f2273022e9d2ddecd7e5e3b8.tar.xz libdbpp-sqlite-3a7e2b9a7bde4682f2273022e9d2ddecd7e5e3b8.zip |
Reshuffle and add new exceptions
Diffstat (limited to 'libsqlitepp/sqlite-error.cpp')
-rw-r--r-- | libsqlitepp/sqlite-error.cpp | 25 |
1 files changed, 5 insertions, 20 deletions
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 <string.h> -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; } |