Skip to content

Commit

Permalink
Vector unhandled CLR exceptions from the runloop into Perl 6 exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
sorear committed Jul 31, 2010
1 parent a60caf9 commit 1e263f2
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Kernel.cs
Expand Up @@ -660,7 +660,13 @@ public class Kernel {
Frame root_f = new Frame(null, null, boot);
Frame current = root_f;
while (current != null) {
current = current.Continue();
try {
current = current.Continue();
} catch (Exception ex) {
ExceptionPacket ep = new FatalException(
new CLRImportObject(ex));
current = ep.SearchForHandler(current);
}
}
}

Expand Down Expand Up @@ -747,7 +753,9 @@ public abstract class ExceptionPacket {
}
}

throw new Exception("--- Unhandled exception in Perl 6 code ---");
Console.Error.WriteLine("--- Unhandled exception in Perl 6 code ---");
Environment.Exit(1);
return null;
// TODO: backtrace, .Str
}
}
Expand Down

0 comments on commit 1e263f2

Please sign in to comment.