From a90331f5b8c7fd725d361003048b70ba0b02fc92 Mon Sep 17 00:00:00 2001 From: Yuxiao Mao Date: Mon, 20 May 2024 15:12:01 +0200 Subject: [PATCH] Rename error to errorMessageAndResponse --- src/HLAdapter.hx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/HLAdapter.hx b/src/HLAdapter.hx index ec8856b..fd6e356 100644 --- a/src/HLAdapter.hx +++ b/src/HLAdapter.hx @@ -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()); } @@ -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; } @@ -160,7 +160,7 @@ class HLAdapter extends DebugSession { }); } - function error(response:Response, message:Dynamic) { + function errorMessageAndResponse(response:Response, message:Dynamic) { errorMessage("ERROR : " + message); sendErrorResponse(cast response, 3000, "" + message); } @@ -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})'); }); } @@ -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();