Skip to content

Commit

Permalink
Also use safecall for pause
Browse files Browse the repository at this point in the history
  • Loading branch information
yuxiaomao committed Apr 19, 2024
1 parent 6e7d379 commit b85b73a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/HLAdapter.hx
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,7 @@ class HLAdapter extends DebugSession {
}
isPause = true;
sendResponse(response);
handleWait(dbg.pause());
safe(() -> handleWait(dbg.pause()));
}

override function disconnectRequest(response:DisconnectResponse, args:DisconnectArguments) {
Expand All @@ -868,12 +868,11 @@ class HLAdapter extends DebugSession {
stopDebug();
}

function safe<T>(f:Void->T) : T {
function safe(f:Void->Void) {
try {
return f();
f();
} catch( e : Dynamic ) {
errorMessage("***** ERRROR ***** "+e+haxe.CallStack.toString(haxe.CallStack.exceptionStack()));
throw e;
}
}

Expand Down

0 comments on commit b85b73a

Please sign in to comment.