[vtkusers] VTK error handling

John Fraser John.Fraser at icr.ac.uk
Thu Aug 26 08:50:05 EDT 2010


Thanks for your replies.

>>Jothy 
>>Why don't you use a if statement to find out whether the file really exists are not?
>>The try to read it.

I was using a file read as an example, for example the source could fail due to out of memory or some other condition.

>>David, I think he wants to put that logic inside the filter and the find out if it failed outside the filter.

I'm not looking to write my own filter.  What I would like to know is, given a particular VTK source / filter, is it possible to know if the filter's Update method has failed or not?  For example a filter could fail due to out of memory or some other condition, is everyone just assuming these filters will always work and not checking them for any error codes?

I think that ITK supports something like the code below, so what I can do in VTK for the equivalent functionality?
try
{
  Update()
}
catch(...)
{
}

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/767602ce/attachment.htm>


More information about the vtkusers mailing list