-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot catch constraint exception #53
Comments
I can confirm that in VS2015. But i cant figure out why.... As soon as the exception is thrown Abort() is getting called as if there where no catch. |
@Killili it seems that we are violating library standards! take a look at my SO question |
But it seems to me that if we don't use I've spent a couple of hours on this, kind of brain dead now 💀 |
Its strange and i can not understand why the standard enforces the |
I'm trying to insert a row that produces a primary key constraint failure but the program crashes before I can catch the exception.
try {
db << "INSERT INTO tb_mytable (mytable_id,description) VALUES (?,?)" << 1 << "cannot catch exception";
// inserting again to produce error
db << "INSERT INTO tb_mytable (mytable_id,description) VALUES (?,?)" << 1 << "cannot catch exception";
} catch (exception e)
{
cerr << e.what() << endl;
} catch (...)
{
cerr << "this does not work either" << endl;
}
libc++abi.dylib: terminating with uncaught exception of type sqlite::exceptions::constraint: constraint failed
The program has unexpectedly finished.
The text was updated successfully, but these errors were encountered: