SOCI / soci

Official repository of the SOCI - The C++ Database Access Library
http://soci.sourceforge.net/
Boost Software License 1.0
1.42k stars 478 forks source link

Core firebird if db close connect #760

Open kireevm96 opened 5 years ago

kireevm96 commented 5 years ago

How to catch an error if the connection is closed?

Error in manual update: connection shutdown db_soci_error: connection shutdown terminate called after throwing an instance of 'soci::firebird_soci_error' what(): connection shutdown Aborted (core dumped)

Try { ... } catch (firebird_soci_error const &e)
{
_CLOGERR(OIMPORT) << "db_soci_error: " << e.what(); }
catch (soci::soci_error const &e)
{
_CLOGERR(OIMPORT) << "soci_error: " << e.what();

}  
vadz commented 5 years ago

Catching the exception should definitely work and seemingly does. It's not clear why does your program crash, please try debugging it or, at the very least, reproduce the issue in the SOCI test suite.