[IronPython] Code broken in RC2
Dino Viehland
dinov at exchange.microsoft.com
Mon Aug 21 20:31:13 CEST 2006
Yep, FormatException is the right API to call.
-----Original Message-----
From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Stanislas Pinte
Sent: Monday, August 21, 2006 9:21 AM
To: Discussion of IronPython
Subject: Re: [IronPython] Code broken in RC2
by looking at IronPythonConsole sources, it seems it might be like:
private static void DefaultExceptionHandler(object sender, UnhandledExceptionEventArgs args) {
MyConsole.WriteLine("Unhandled exception: ", Style.Error);
MyConsole.Write(engine.FormatException((Exception)args.ExceptionObject),
Style.Error);
}
Can anyone from the team confirm this?
Thanks a lot,
Stan.
Stanislas Pinte a écrit :
> Hello,
>
> I was using the Console class to get a more or less clean dump of
> exceptions in my embedded scripting engine:
>
> DummyConsole dummy = new DummyConsole(); engine.MyConsole = dummy;
> engine.DumpException(nested);
>
> This code is now broken in IronPython RC2...any suggestions on how to
> fix this?
>
> Thanks a lot,
>
> Stan.
>
> internal class DummyConsole : IConsole
> {
> private StringBuilder stringBuilder = new StringBuilder();
>
> public string ReadLine(int autoIndentSize)
> {
> throw new NotImplementedException();
> }
>
> public void Write(string text, Style style)
> {
> //Console.Out.Write(text, style);
> stringBuilder.Append(text);
> }
>
> public void WriteLine(string text, Style style)
> {
> //Console.Out.WriteLine(text, style);
> stringBuilder.Append(text);
> stringBuilder.AppendLine();
> }
>
> internal string FlushBuffer()
> {
> string value = stringBuilder.ToString();
> stringBuilder = new StringBuilder();
> return value;
> }
> }
>
--
-----------------------------------------------------------------
Stanislas Pinte e-mail: stan at ertmssolutions.com
ERTMS Solutions http://www.ertmssolutions.com
Rue de l'Autonomie, 1 Tel: + 322 - 522.06.63
1070 Bruxelles Fax: + 322 - 522.09.30
-----------------------------------------------------------------
Skype (http://www.skype.com) id: stanpinte
-----------------------------------------------------------------
_______________________________________________
users mailing list
users at lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
More information about the Ironpython-users
mailing list