소스 검색

break on exception thrown

Nicolas Cannasse 7 년 전
부모
커밋
1e5545e611
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      hxd/System.hl.hx

+ 3 - 0
hxd/System.hl.hx

@@ -113,11 +113,14 @@ class System {
 	}
 
 	static function runMainLoop() {
+		var reportError = function(e) reportError(e);
 		while( true ) {
 			try {
+				hl.Api.setErrorHandler(reportError); // set exception trap
 				@:privateAccess haxe.MainLoop.tick();
 				if( !mainLoop() ) break;
 			} catch( e : Dynamic ) {
+				hl.Api.setErrorHandler(null);
 				reportError(e);
 			}
 		}