diff --git a/src/Tgstation.Server.Host/Components/StaticFiles/Configuration.cs b/src/Tgstation.Server.Host/Components/StaticFiles/Configuration.cs index f62bf504ba..90c7a4d218 100644 --- a/src/Tgstation.Server.Host/Components/StaticFiles/Configuration.cs +++ b/src/Tgstation.Server.Host/Components/StaticFiles/Configuration.cs @@ -216,10 +216,6 @@ namespace Tgstation.Server.Host.Components.StaticFiles Path = configurationRelativePath }; } - catch (IOException e) - { - logger.LogDebug("IOException while reading {0}: {1}", path, e); - } catch (UnauthorizedAccessException) { //this happens on windows, dunno about linux @@ -308,10 +304,6 @@ namespace Tgstation.Server.Host.Components.StaticFiles Path = configurationRelativePath }; } - catch (IOException e) - { - logger.LogDebug("IOException while writing {0}: {1}", path, e); - } catch (UnauthorizedAccessException) { //this happens on windows, dunno about linux diff --git a/src/Tgstation.Server.Host/Controllers/ConfigurationController.cs b/src/Tgstation.Server.Host/Controllers/ConfigurationController.cs index c362107fb5..34ded3ea45 100644 --- a/src/Tgstation.Server.Host/Controllers/ConfigurationController.cs +++ b/src/Tgstation.Server.Host/Controllers/ConfigurationController.cs @@ -1,6 +1,7 @@ using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; using System; +using System.IO; using System.Net; using System.Threading; using System.Threading.Tasks; @@ -54,12 +55,23 @@ namespace Tgstation.Server.Host.Controllers { var newFile = await config.Write(model.Path, AuthenticationContext.SystemIdentity, model.Content, model.LastReadHash, cancellationToken).ConfigureAwait(false); if (newFile == null) - return Conflict(); + return Conflict(new ErrorMessage + { + Message = "" + }); newFile.Content = null; return model.LastReadHash == null ? (IActionResult)StatusCode((int)HttpStatusCode.Created, newFile) : Json(newFile); } + catch(IOException e) + { + Logger.LogInformation("IOException while updating file {0}: {1}", model.Path, e); + return Conflict(new ErrorMessage + { + Message = e.Message + }); + } catch (NotImplementedException) { return StatusCode((int)HttpStatusCode.NotImplemented); @@ -87,6 +99,14 @@ namespace Tgstation.Server.Host.Controllers return Json(result); } + catch (IOException e) + { + Logger.LogInformation("IOException while reading file {0}: {1}", filePath, e); + return Conflict(new ErrorMessage + { + Message = e.Message + }); + } catch (NotImplementedException) { return StatusCode((int)HttpStatusCode.NotImplemented); diff --git a/src/Tgstation.Server.Host/Controllers/RepositoryController.cs b/src/Tgstation.Server.Host/Controllers/RepositoryController.cs index 8a072f598d..4de3cae653 100644 --- a/src/Tgstation.Server.Host/Controllers/RepositoryController.cs +++ b/src/Tgstation.Server.Host/Controllers/RepositoryController.cs @@ -330,7 +330,6 @@ namespace Tgstation.Server.Host.Controllers var api = canRead ? currentModel.ToApi() : new Repository(); var repoManager = instanceManager.GetInstance(Instance).RepositoryManager; - if (canRead) { if (repoManager.CloneInProgress)