Refactored the error params, so that exception is before the message/template so its more in sync with Serilog signature & was an easy way to find some more logs I missed too

This commit is contained in:
Warren
2018-08-17 15:41:58 +01:00
parent 38984181fc
commit 9e996c68bb
98 changed files with 219 additions and 223 deletions

View File

@@ -56,13 +56,13 @@ namespace Umbraco.Web.HealthCheck.Checks.Config
Result = string.Format(xmlNode.Value ?? xmlNode.InnerText)
};
}
catch (Exception exception)
catch (Exception ex)
{
Current.Logger.Error<ConfigurationService>("Error trying to get configuration value", exception);
Current.Logger.Error<ConfigurationService>(ex, "Error trying to get configuration value");
return new ConfigurationServiceResult
{
Success = false,
Result = _textService.Localize("healthcheck/configurationServiceError", new[] { exception.Message })
Result = _textService.Localize("healthcheck/configurationServiceError", new[] { ex.Message })
};
}
}
@@ -102,13 +102,13 @@ namespace Umbraco.Web.HealthCheck.Checks.Config
xmlDocument.Save(_configFilePath);
return new ConfigurationServiceResult { Success = true };
}
catch (Exception exception)
catch (Exception ex)
{
Current.Logger.Error<ConfigurationService>("Error trying to update configuration", exception);
Current.Logger.Error<ConfigurationService>(ex, "Error trying to update configuration");
return new ConfigurationServiceResult
{
Success = false,
Result = _textService.Localize("healthcheck/configurationServiceError", new[] { exception.Message })
Result = _textService.Localize("healthcheck/configurationServiceError", new[] { ex.Message })
};
}
}