Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Better reporting on startup crashes.
  • Loading branch information
jnthn committed Apr 7, 2013
1 parent 71e44a5 commit a23e7ec
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/org/perl6/nqp/runtime/ExceptionHandling.java
Expand Up @@ -23,12 +23,19 @@ public class ExceptionHandling {
* handler model. Note the exception is not resumable. */
private static RuntimeException stooge = new RuntimeException("Stooge exception leaked");
public static RuntimeException dieInternal(ThreadContext tc, String msg) {
SixModelObject exType = tc.curFrame.codeRef.staticInfo.compUnit.hllConfig.exceptionType;
VMExceptionInstance exObj = (VMExceptionInstance)exType.st.REPR.allocate(tc, exType.st);
exObj.initialize(tc);
exObj.message = msg;
exObj.category = ExceptionHandling.EX_CAT_CATCH;
exObj.origin = tc.curFrame;
SixModelObject exType;
VMExceptionInstance exObj;
try {
exType = tc.curFrame.codeRef.staticInfo.compUnit.hllConfig.exceptionType;
exObj = (VMExceptionInstance)exType.st.REPR.allocate(tc, exType.st);
exObj.initialize(tc);
exObj.message = msg;
exObj.category = ExceptionHandling.EX_CAT_CATCH;
exObj.origin = tc.curFrame;
}
catch (Exception e) {
throw new RuntimeException(msg);
}
handlerDynamic(tc, ExceptionHandling.EX_CAT_CATCH, exObj);
return stooge;
}
Expand Down

0 comments on commit a23e7ec

Please sign in to comment.