[vtkusers] VTK error handling

John Fraser John.Fraser at icr.ac.uk
Thu Aug 26 07:24:03 EDT 2010


Hello,

I was wondering if anyone can give some advice on VTK and error / exception handling.  For example, if I have something like this:

vtkSmartPointer<vtkImageReader> imageReader = vtkSmartPointer<vtkImageReader>::New();
imageReader->SetFileName("NoSuchFile.bin");
... etc
imageReader->Update();

NoSuchFile.bin does not exist.  Now when Update is executed an error window pops up (which I can remove by setting a vtkFileOutputWindow instead), but how can I checked programmatically that the Update did not succeed due to the file not being found or out of memory, etc?  I have tried, try/catch and GetErrorCode (which always seems to return 0?) and looked through the books but there is no mention of error handling.

John

The Institute of Cancer Research: Royal Cancer Hospital, a charitable Company Limited by Guarantee, Registered in England under Company No. 534147 with its Registered Office at 123 Old Brompton Road, London SW7 3RP.

This e-mail message is confidential and for use by the addressee only.  If the message is received by anyone other than the addressee, please return the message to the sender by replying to it and then delete the message from your computer and network.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100826/988452f7/attachment.htm>


More information about the vtkusers mailing list