Error added when a VTK file cannot be created

This prevents the main process from crashing and freezing the code. Now it exits properly.