<div dir="ltr">Why don't you use a if statement to find out whether the file really exists are not?<br><br>The try to read it.<br><br>Jothy<br><br><div class="gmail_quote">On Thu, Aug 26, 2010 at 12:24 PM, John Fraser <span dir="ltr"><<a href="mailto:John.Fraser@icr.ac.uk">John.Fraser@icr.ac.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div style="margin: 4px 4px 1px; font: 10pt Tahoma;">
<div>Hello,</div>
<div> </div>
<div>I was wondering if anyone can give some advice on VTK and error / exception handling. For example, if I have something like this:</div>
<div> </div>
<div>vtkSmartPointer<vtkImageReader> imageReader = vtkSmartPointer<vtkImageReader>::New();<br>imageReader->SetFileName("NoSuchFile.bin");<br>... etc<br>imageReader->Update();</div>
<div> </div>
<div>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.</div>
<div> </div><font color="#888888">
<div>John</div>
<div> </div></font></div><br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br></div>