<ol><li><strong>Debug mode:</strong> Exceptions thrown by the code (no by STL functions) must be inside a debug mode condition set in the ADIOS class constructor. Applications are encourages to turn these on when integrating with ADIOS2.</li><li><strong>Standard exception:</strong> Throw C++ standard exceptions for error handling, do not throw integers. This is helpful as it allows handling of different exception types in different ways. In rare cases a custom exceptions must be defined/declared.<ul><li><code>Don't</code><ul><li><prestyle="border: 0;"><code> throw 1;</code></pre></li></ul></li><li><code>Do</code><ul><li><prestyle="border: 0;"><code> throw std::invalid_argument ( "ERROR: group was not
previously declared, in call to Write" );</code></pre></li></ul></li></ul></li><li><strong>Document exceptions:</strong> All error exceptions must start with "ERROR: ". Use informative and precise messages for exception handling to complement the nature of the exception to help the user identify and fix the issue.<ul><li><code>Don't</code><ul><li><prestyle="border: 0;"><code> throw std::invalid_argument ( "ERROR: invalid input for CompressionParameter" );</code></pre></li></ul></li><li><code>Do</code><ul><li><prestyle="border: 0;"><code> throw std::invalid_argument( "ERROR: bzip2 CompressionParameter
must be an unsigned int between 0 and 9,
previously declared, in call to Write" );</code></pre></li></ul></li></ul></li><li><strong>Document exceptions:</strong> All error exceptions must start with "ERROR: ". Use informative and precise messages for exception handling to complement the nature of the exception to help the user identify and fix the issue.<ul><li><code>Don't</code><ul><li><prestyle="border: 0;"><code> throw std::invalid_argument ( "ERROR: invalid input for CompressionParameter" );</code></pre></li></ul></li><li><code>Do</code><ul><li><prestyle="border: 0;"><code> throw std::invalid_argument( "ERROR: bzip2
CompressionParameter must be an unsigned int between 0 and 9,
in call to Compress"" );</code></pre></li></ul></li></ul></li></ol>