Skip to content

Commit

Permalink
Rename error to errorMessageAndResponse
Browse files Browse the repository at this point in the history
  • Loading branch information
yuxiaomao committed May 20, 2024
1 parent 8a3195a commit a90331f
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/HLAdapter.hx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class HLAdapter extends DebugSession {
if( args.allowEval != null ) allowEvalGetters = args.allowEval;

function onError(e) {
error(cast response, e + "\n" + haxe.CallStack.toString(haxe.CallStack.exceptionStack()));
errorMessageAndResponse(cast response, e + "\n" + haxe.CallStack.toString(haxe.CallStack.exceptionStack()));
sendEvent(new TerminatedEvent());
}

Expand Down Expand Up @@ -151,7 +151,7 @@ class HLAdapter extends DebugSession {
Sys.setCwd(workspaceDirectory);
startDebug(args.program,args.port, function(msg) {
if( msg != null ) {
error(cast response, msg);
errorMessageAndResponse(cast response, msg);
sendEvent(new TerminatedEvent());
return;
}
Expand All @@ -160,7 +160,7 @@ class HLAdapter extends DebugSession {
});
}

function error<T>(response:Response<T>, message:Dynamic) {
function errorMessageAndResponse<T>(response:Response<T>, message:Dynamic) {
errorMessage("ERROR : " + message);
sendErrorResponse(cast response, 3000, "" + message);
}
Expand Down Expand Up @@ -282,9 +282,9 @@ class HLAdapter extends DebugSession {
});
proc.on('error', function(err) {
if( err.message == "spawn hl ENOENT" )
error(cast response, "Could not start 'hl' process, executable was not found in PATH.\nRestart VSCode or computer.");
errorMessageAndResponse(cast response, "Could not start 'hl' process, executable was not found in PATH.\nRestart VSCode or computer.");
else
error(cast response, 'Failed to start hl process (${err.message})');
errorMessageAndResponse(cast response, 'Failed to start hl process (${err.message})');
});
}

Expand Down Expand Up @@ -323,7 +323,6 @@ class HLAdapter extends DebugSession {
msg += ". On Linux, please try set /proc/sys/kernel/yama/ptrace_scope to 0.";
onError(msg);
return;
return;
}
dbg.eval.allowEvalGetters = allowEvalGetters;
syncThreads();
Expand Down

0 comments on commit a90331f

Please sign in to comment.