diff --git a/include/SQLiteCpp/Exception.h b/include/SQLiteCpp/Exception.h index 3b0b772..efc9fb5 100644 --- a/include/SQLiteCpp/Exception.h +++ b/include/SQLiteCpp/Exception.h @@ -50,6 +50,7 @@ public: * * @param[in] aErrorMessage The string message describing the SQLite error */ + explicit Exception(const char* aErrorMessage); explicit Exception(const std::string& aErrorMessage); /** @@ -58,6 +59,7 @@ public: * @param[in] aErrorMessage The string message describing the SQLite error * @param[in] ret Return value from function call that failed. */ + Exception(const char* aErrorMessage, int ret); Exception(const std::string& aErrorMessage, int ret); /** diff --git a/src/Exception.cpp b/src/Exception.cpp index c2f0304..69e114e 100644 --- a/src/Exception.cpp +++ b/src/Exception.cpp @@ -16,6 +16,12 @@ namespace SQLite { +Exception::Exception(const char* aErrorMessage) : + std::runtime_error(aErrorMessage), + mErrcode(-1), // 0 would be SQLITE_OK, which doesn't make sense + mExtendedErrcode(-1) +{ +} Exception::Exception(const std::string& aErrorMessage) : std::runtime_error(aErrorMessage), mErrcode(-1), // 0 would be SQLITE_OK, which doesn't make sense @@ -23,6 +29,13 @@ Exception::Exception(const std::string& aErrorMessage) : { } +Exception::Exception(const char* aErrorMessage, int ret) : + std::runtime_error(aErrorMessage), + mErrcode(ret), + mExtendedErrcode(-1) +{ +} + Exception::Exception(const std::string& aErrorMessage, int ret) : std::runtime_error(aErrorMessage), mErrcode(ret),