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