[vtkusers] Handling crashes when reading a corrupted file in Java

Gilles Monnier gilles_monnier at yahoo.fr
Mon Apr 2 12:16:26 EDT 2012


Hi,

I'm currently trying to find a way to manage vtk crashes when opening a file in Java.
Here is below a simple code:

vtkSTLReader stlReader = new vtkSTLReader();
stlReader.SetFileName(inputFile.getAbsolutePath());
stlReader.Update();

If the file given by parameter is not a correct STL file (In this example it is a STL reader but this is the case for all readers), the application will crash during the "update()" call.

Is there a way to handle these errors (by throwing exceptions) ?

Thanks much
Gilles
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120402/e8506713/attachment.htm>


More information about the vtkusers mailing list