From: Peter van Dijk Date: Fri, 11 Nov 2016 17:58:32 +0000 (+0100) Subject: throw actual exceptions instead of strings so that they get caught and reported properly X-Git-Tag: dnsdist-1.1.0-beta2~40^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c7da8b97eafe7ea1099ba52e0e035cca28d535fa;p=thirdparty%2Fpdns.git throw actual exceptions instead of strings so that they get caught and reported properly --- diff --git a/modules/godbcbackend/sodbc.cc b/modules/godbcbackend/sodbc.cc index 36431eab01..084be297d5 100644 --- a/modules/godbcbackend/sodbc.cc +++ b/modules/godbcbackend/sodbc.cc @@ -246,7 +246,7 @@ private: std::string errorMessage; if (!realTestResult(result, type, handle, message, errorMessage)) { releaseStatement(); - throw errorMessage; + throw SSqlException(errorMessage); } } @@ -476,5 +476,5 @@ void SODBC::rollback() { void SODBC::testResult(SQLRETURN result, SQLSMALLINT type, SQLHANDLE handle, const std::string & message) { std::string errorMessage; - if (!realTestResult(result, type, handle, message, errorMessage)) throw errorMessage; + if (!realTestResult(result, type, handle, message, errorMessage)) throw SSqlException(errorMessage); }