[Ironpython-users] ErrorListener

Keith Rome rome at Wintellect.com
Wed Oct 12 16:04:06 CEST 2011


Is there a notion of "Warning" in context of execution? My understanding is that during execution you either get a single error, or you get the resulting value (or void/null if the script does not eval to a return value). Any print() messages are routed to the stdout stream which you can also intercept via the script engine's IO property. Perhaps that kind of trace output is what you are looking for?


Keith Rome
Senior Consultant and Architect
MCPD-EAD, MCSD, MCDBA, MCTS-WPF, MCTS-TFS, MCTS-WSS
Wintellect | 770.617.4016 | krome at wintellect.com
www.wintellect.com


-----Original Message-----
From: ironpython-users-bounces+rome=wintellect.com at python.org [mailto:ironpython-users-bounces+rome=wintellect.com at python.org] On Behalf Of Markus Schaber
Sent: Wednesday, October 12, 2011 9:50 AM
To: Jimmy Schementi
Cc: ironpython-users at python.org
Subject: Re: [Ironpython-users] ErrorListener

Hi, Jimmy,

Von: Jimmy Schementi [mailto:jschementi at gmail.com]

> >> Sorry for disturbing again, but I'm a little bit confused about the 
> >> ErrorListeners from the Hosting API.
> >>
> >> For compilation of a ScriptSource, I can pass an ErrorListener 
> >> which gets the errors and warnings, but it seems that I cannot pass 
> >> an ErrorListener for the execution of the ScriptSource.
> >>
> >> My guess is that the ErrorListener passed to the compilation is 
> >> referenced from the compiled ScriptSource. Can you confirm hat? Or 
> >> did I miss something?
> >
> > This guess seems wrong - it seems that the warnings are simply spit 
> > out
> on stderr by default.
> 
> ErrorListener is only used for compiler errors; if you want to capture 
> runtime errors you can put a try/catch around the call to 
> ScriptSource.Execute().

It's not about the errors, but about the warnings. We run IronPython embedded (hosted) in our application, and want to capture the warnings to display them in a different window.

Best regards

Markus Schaber
--
___________________________
We software Automation.

3S-Smart Software Solutions GmbH
Markus Schaber | Developer
Memminger Str. 151 | 87439 Kempten | Germany | Tel. +49-831-54031-0 | Fax +49-831-54031-50

Email: m.schaber at 3s-software.com | Web: http://www.3s-software.com CoDeSys internet forum: http://forum.3s-software.com Download CoDeSys sample projects: http://www.3s-software.com/index.shtml?sample_projects

Managing Directors: Dipl.Inf. Dieter Hess, Dipl.Inf. Manfred Werner | Trade register: Kempten HRB 6186 | Tax ID No.: DE 167014915 

_______________________________________________
Ironpython-users mailing list
Ironpython-users at python.org
http://mail.python.org/mailman/listinfo/ironpython-users



More information about the Ironpython-users mailing list