Skip to content

Make AdiosWriter::write() and VTKOutput::write() fail more gracefully

Marcus Mohr requested to merge mohr/gracefulFail into master

In the case that one of the functions registered with one of these writers does not support the level value passed to write() the code currently just throws an std::out_of_range exception, which does not get caught. Thus, the user ends up with

Execution failed: Uncaught Exception.
map::at

The MR adds a try-catch construct that catches the exception and then WALBERLA_ABORTs with a sensbile message.

I am open for suggestions, if someone thinks another approach to handle this would be preferable. I don't think we have been relying on try/catch before. Also one could try to handle this at a deeper level, closer to where the problem is detected.

But for the moment IHMO this enhances usability.

Merge request reports