3
0
mirror of https://github.com/triqs/dft_tools synced 2024-11-01 11:43:47 +01:00
dft_tools/doc/reference/utilities/exceptions.rst
tayral edd1ff4529 Restructuring documentation.
A first general restructuration of the doc according to the pattern [tour|tutorial|reference].
In the reference part, objects are documented per topic.
In each topic, [definition|c++|python|hdf5] (not yet implemented)
2014-10-18 12:21:08 +01:00

30 lines
752 B
ReStructuredText

.. highlight:: c
.. _util_exceptions:
Exceptions
=============
TRIQS defines special exceptions, with the following characteristics :
* they derives from std::exceptions
* their .what() contains:
* the file and line where the exception occurred
* an additionnal error message (see example below). The error behaves like a std::stringstream,
one can accumulate any message
* a complete stack strace of the C++ code at the exception point, with demangling of the function name (on gcc and clang).
.. warning::
For uniformity, it is highly recommended to use these macros when developing for TRIQS.
Example:
.. triqs_example:: ./exceptions_0.cpp
The exception can of course be caught :
.. triqs_example:: ./exceptions_1.cpp