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

Sebastien Jourdain sebastien.jourdain at kitware.com
Mon Apr 2 12:27:36 EDT 2012


If the C++ layer crash, there is no way that Java could handle that.

On Mon, Apr 2, 2012 at 12:16 PM, Gilles Monnier <gilles_monnier at yahoo.fr> wrote:
> 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
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>



More information about the vtkusers mailing list