Fix deprecation warning

This commit is contained in:
ryuukk 2023-07-29 18:36:00 +02:00 committed by Jan Jurzitza
parent 1c60c5480f
commit 70061aee2e
1 changed files with 29 additions and 26 deletions

View File

@ -260,8 +260,7 @@ AutocompleteResponse getResponse(Socket socket)
*/
bool serverIsRunning(bool useTCP, string socketFile, ushort port)
{
scope (failure)
return false;
try {
AutocompleteRequest request;
request.kind = RequestKind.query;
Socket socket;
@ -290,6 +289,10 @@ bool serverIsRunning(bool useTCP, string socketFile, ushort port)
return getResponse(socket).completionType == "ack";
else
return false;
}
catch (Exception _) {
return false;
}
}
/// Escapes \n, \t and \ in the string. If `single` is true \t won't be escaped.