mirror of
https://github.com/oatpp/oatpp-postgresql.git
synced 2024-11-27 02:39:56 +08:00
Executor: throw if it's impossible to return a connection.
This commit is contained in:
parent
ee6c6de4f6
commit
06df476b19
@ -283,7 +283,11 @@ data::share::StringTemplate Executor::parseQueryTemplate(const oatpp::String& na
|
||||
}
|
||||
|
||||
std::shared_ptr<orm::Connection> Executor::getConnection() {
|
||||
return m_connectionProvider->get();
|
||||
auto connection = m_connectionProvider->get();
|
||||
if(connection) {
|
||||
return connection;
|
||||
}
|
||||
throw std::runtime_error("[oatpp::postgresql::Executor::getConnection()]: Error. Can't connect.");
|
||||
}
|
||||
|
||||
std::shared_ptr<orm::QueryResult> Executor::execute(const StringTemplate& queryTemplate,
|
||||
|
Loading…
Reference in New Issue
Block a user