[Paraview-developers] Handling exceptions from within a Plug-in

Ellon Paiva ellonpaiva at gmail.com
Fri May 13 09:53:51 EDT 2016


Hello again Mathieu,

Nenermind my last email: vtkErrorMacro works as expected. :)

Thank you for your help!

Best regards,
Ellon

On 05/13/2016 03:41 PM, Ellon Paiva wrote:
> Mathieu,
>
> I tried the vtkErrorMacro and I got the messages being printed in the 
> standard error in the terminal, which is not exactly what I want.
>
> What I am looking for is something like it's shown in the attached 
> image: here I forced an error in a python programable filter through a 
> syntax error in the script. As you can see the user get an information 
> about the error in the "Output Messages" window that pops up when 
> "Apply" is pressed, as well as in the terminal. How could I print the 
> error message in this Output Window on ParaView?
>
> Regards,
>
> Ellon
>
>
> On 05/13/2016 03:05 PM, Mathieu Westphal wrote:
>> Hello
>>
>> vtkErrorMacro is the way to go to inform the user of the error, but 
>> it will not exit the method, only inform.
>> After that you need to return 0 if you want the pipeline execution to 
>> stop.
>>
>> Regards,
>>
>>
>>
>>
>> Mathieu Westphal
>>
>> On Fri, May 13, 2016 at 2:54 PM, Ellon Paiva <ellonpaiva at gmail.com 
>> <mailto:ellonpaiva at gmail.com>> wrote:
>>
>>     Hello Mathieu,
>>
>>     Thanks for your answer.
>>
>>     I think I was not clear in my question. Surely I can catch the
>>     exception in the plugin, but I'm looking for a way to inform
>>     paraview that an error occurred while executing the filter. Of
>>     course this information should be passed to ParaView when
>>     handling the exception, and probably it should halt the
>>     processing of the pipeline as well.
>>
>>     I'm looking now into the files of some plugins inside paraview
>>     source. I found that some plugins use the macro "vtkErrorMacro".
>>     Would this work for me?
>>
>>     Regards,
>>
>>     Ellon
>>
>>
>>     On 05/13/2016 02:47 PM, Mathieu Westphal wrote:
>>>     Hello
>>>
>>>     I supose it's kind of obvious, but why would catch not work ?
>>>     you should be able to catch your library exception in your filter.
>>>
>>>     Regards,
>>>
>>>     Mathieu Westphal
>>>
>>>     On Fri, May 13, 2016 at 2:39 PM, Ellon Paiva
>>>     <ellonpaiva at gmail.com> wrote:
>>>
>>>         Hello all,
>>>
>>>         I have a plug-in for paraview that wraps filters from an
>>>         specific library, and these filters that may throw
>>>         exceptions when if not configured properly (example, if the
>>>         input data doesn't have some fields). I've been looking for
>>>         a way to catch these exceptions inside the plug-in and
>>>         inform paraview about the error/problem, like for example
>>>         showing the error information in the paraview error window,
>>>         but I couldn't find an explanation of how to do that. Could
>>>         anyone explain me how to do that or show an example of code
>>>         for that?
>>>
>>>         Regards,
>>>         Ellon
>>>         _______________________________________________
>>>         Powered by www.kitware.com <http://www.kitware.com>
>>>
>>>         Visit other Kitware open-source projects at
>>>         http://www.kitware.com/opensource/opensource.html
>>>
>>>         Search the list archives at:
>>>         http://markmail.org/search/?q=Paraview-developers
>>>
>>>         Follow this link to subscribe/unsubscribe:
>>>         http://public.kitware.com/mailman/listinfo/paraview-developers
>>>
>>>
>>
>>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview-developers/attachments/20160513/288d5083/attachment.html>


More information about the Paraview-developers mailing list