Problem
There are certain exceptions that cannot be handled within the library. Exceptions thrown due to a failure to allocate heap memory or a mutex locking error are currently unhandled and violate internal invariants. Moreover, such exceptions render further operation impossible.
Solution
Call std::terminate if exception happend:
- Failure of memory allocation
- Failure of standart containers and algorithms functions (related to memory allocation mostly)
- Failure of library functions, such as boost::asio::post
- Failure of any waiting operation, including std::mutex::lock (and related)
This list in is not complete and may be expanded.
Note
This approach to exception handling is implemented by default in Go, so I consider it acceptable. These are the best guarantees a library can provide.
Problem
There are certain exceptions that cannot be handled within the library. Exceptions thrown due to a failure to allocate heap memory or a mutex locking error are currently unhandled and violate internal invariants. Moreover, such exceptions render further operation impossible.
Solution
Call std::terminate if exception happend:
This list in is not complete and may be expanded.
Note
This approach to exception handling is implemented by default in Go, so I consider it acceptable. These are the best guarantees a library can provide.