SOCI / soci

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

Core firebird if db close connect #760

Open kireevm96 opened 4 years ago

kireevm96 commented 4 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 4 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.