diff --git a/MeshLib/IO/writeMeshToFile.cpp b/MeshLib/IO/writeMeshToFile.cpp index 602cbfbf4fd6343b4478997c062dd9e48df89320..13b547e1a6742ecfba3f8d4123d5f1ba98f04e58 100644 --- a/MeshLib/IO/writeMeshToFile.cpp +++ b/MeshLib/IO/writeMeshToFile.cpp @@ -34,7 +34,13 @@ int writeMeshToFile(const MeshLib::Mesh &mesh, const std::string &file_name) if (BaseLib::hasFileExtension("vtu", file_name)) { MeshLib::IO::VtuInterface writer(&mesh); - writer.writeToFile(file_name); + auto const result = writer.writeToFile(file_name); + if (!result) + { + ERR("writeMeshToFile(): Could not write mesh to '%s'.", + file_name.c_str()); + return -1; + } return 0; }