<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,
in call to Compress"" );</code></pre></li></ul></li></ul></li></ol>
\ No newline at end of file
1.<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.
2.<strong>Throw C++ standard exceptions:</strong> do not throw integers. This is helpful as it allows handling of different exception types in different ways.
* _Don't_
```cpp
throw 1;
```
* _Do_
```cpp
throw std::invalid_argument ( "ERROR: variable + variableName + "was not
previously declared, in call to Write;" );
```
3.<strong>Document exceptions:</strong> All error exceptions must start with "ERROR: ". Use informative and precise messages to help the user identify and fix the issue.
* _Don't_
```cpp
throw std::invalid_argument( "ERROR: invalid input for CompressionParameter" );
```
* _Do_
```cpp
throw std::invalid_argument( "ERROR: bzip2 bzip2_blockSize100K parameters must be between 0 and 9,