vtk error handling is not very helpful

This commit is contained in:
Martin Diehl 2020-11-18 16:18:57 +01:00
parent 86dfb58732
commit c74e57f225
1 changed files with 4 additions and 0 deletions

View File

@ -1,3 +1,4 @@
import os
import multiprocessing as mp
from pathlib import Path
@ -165,6 +166,9 @@ class VTK:
else:
raise TypeError(f'Unknown file extension {ext}')
if not os.path.isfile(fname):
raise FileNotFoundError(f'No such file: {fname}')
reader.SetFileName(str(fname))
reader.Update()
vtk_data = reader.GetOutput()