|
163 | 163 | /** @defgroup data_view Data View*/ |
164 | 164 | /** @defgroup synchronization Synchronization Primitives*/ |
165 | 165 | /** @defgroup primitives Primitives*/ |
166 | | -/** @defgroup exceptions Exceptions*/ |
| 166 | +/** @defgroup exceptions Exceptions |
| 167 | + * Possible exceptions that could be thrown by the libpmemobj++. |
| 168 | + * |
| 169 | + * In runtime, some operations may fail, then all you need is to catch the exception. |
| 170 | + * Every pmem exception has **std::runtime_error** in its inheritance tree |
| 171 | + * and contains proper message with an error description. |
| 172 | + * All exceptions can be caught using just **std::runtime_error**. |
| 173 | + * Look at the list on this page to explore all exceptions with their descriptions. |
| 174 | + * |
| 175 | + * Transaction handles uncaught exceptions thrown inside its scope, then aborts |
| 176 | + * and rethrow the previous exception. That way you never loose the original |
| 177 | + * exception and at the same time, the transaction state is handled |
| 178 | + * properly by the library. |
| 179 | + * |
| 180 | + * Let's consider following example: |
| 181 | + * @snippet examples/mpsc_queue/mpsc_queue.cpp mpsc_main |
| 182 | + * |
| 183 | + * There are plenty of try-catch blocks placed to handle possible errors that can happen in some conditions. |
| 184 | + * E.g. @ref pmem::obj::pool<T>::open can lead to @ref pmem::pool_error. |
| 185 | + * Next exception, **std::exception**, is placed to handle possible errors during allocation, |
| 186 | + * coming from @ref pmem::obj::make_persistent. Worth being careful using every new function |
| 187 | + * because some of exceptions are not obvious, e.g., pmem::obj::pool<T>::close |
| 188 | + * at the end of the code which may throw **std::logic_error**. |
| 189 | + * |
| 190 | + * You should check every function you will use in context of possible |
| 191 | + * exceptions and then handle them to avoid crash. |
| 192 | + **/ |
0 commit comments