We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi!
I suppose I found a problem in the library.
A trivial example. I want to use a static string without any memory allocation and I want to get an exception if it fails because of the string size:
try { boost::beast::static_string<5> str; // it throws std::length_error in boost::beast::static_string::push_back() fmt::format_to(std::back_inserter(str), "test{}", 123); } catch (const std::length_error &e) { std::clog << "ee " << e.what() << std::endl; }
As result, the app was terminated with SIGABRT
I think the problem is here:
~iterator_buffer() { flush(); }
While exception unwinding iterator_buffer's destructor is called and it tries to write to the buffer again
I believe you can use something like this:
// exception_count(std::uncaught_exceptions()) // in the destructor if (exception_count == std::uncaught_exceptions()) { database->exec("COMMIT"); return; } // Called during stack unwinding. Rollback and don't throw try { database->exec("ROLLBACK"); } catch (const std::exception &e) { std::cerr << "Transaction rollback error: " << e.what() << std::endl; }
The text was updated successfully, but these errors were encountered:
Fix exception propagation from iterators (#2097)
ce519e9
Good catch, thanks! Fixed in ce519e9.
Sorry, something went wrong.
No branches or pull requests
Hi!
I suppose I found a problem in the library.
A trivial example. I want to use a static string without any memory allocation and I want to get an exception if it fails because of the string size:
As result, the app was terminated with SIGABRT
I think the problem is here:
While exception unwinding iterator_buffer's destructor is called and it tries to write to the buffer again
I believe you can use something like this:
The text was updated successfully, but these errors were encountered: