diff --git a/v2rayN/ServiceLib/Handler/WebDavHandler.cs b/v2rayN/ServiceLib/Handler/WebDavHandler.cs index 652c43f2..85d9922f 100644 --- a/v2rayN/ServiceLib/Handler/WebDavHandler.cs +++ b/v2rayN/ServiceLib/Handler/WebDavHandler.cs @@ -98,19 +98,26 @@ namespace ServiceLib.Handler } await TryCreateDir(); - var testName = "readme_test"; - var myContent = new StringContent(testName); - var result = await _client.PutFile($"{_webDir}/{testName}", myContent); - if (result.IsSuccessful) + try { - await _client.Delete($"{_webDir}/{testName}"); - return true; + var testName = "readme_test"; + var myContent = new StringContent(testName); + var result = await _client.PutFile($"{_webDir}/{testName}", myContent); + if (result.IsSuccessful) + { + await _client.Delete($"{_webDir}/{testName}"); + return true; + } + else + { + SaveLog(result.Description); + } } - else + catch (Exception ex) { - SaveLog(result.Description); - return false; + SaveLog(ex); } + return false; } public async Task PutFile(string fileName)