more logging
This commit is contained in:
@@ -38,7 +38,7 @@ namespace ZUGFeRDRESTService.Controllers
|
||||
public ValidationResponse()
|
||||
{
|
||||
status = RESPONSE_OK;
|
||||
message = String.Empty;
|
||||
message = string.Empty;
|
||||
errors = new List<string>();
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ namespace ZUGFeRDRESTService.Controllers
|
||||
{
|
||||
_logger.Debug("Start processing request to ValidationController");
|
||||
|
||||
string oFilePath = Path.Combine(Path.GetTempPath(), file.FileName);
|
||||
string oFilePath = Path.Combine(Path.GetTempPath(), file.FileName);
|
||||
|
||||
_logger.Debug("Saving file to temp-path [{0}]", oFilePath);
|
||||
|
||||
@@ -109,17 +109,22 @@ namespace ZUGFeRDRESTService.Controllers
|
||||
|
||||
oResult = _props.CheckPropertyValues(oDocument, _propertyMap, "MESSAGEID");
|
||||
|
||||
_logger.Debug("Result of checking against the database: {0} valid properties, {1} missing properties", oResult.ValidProperties, oResult.MissingProperties);
|
||||
_logger.Debug("Result of checking against the database: {0} valid properties, {1} missing properties",
|
||||
oResult.ValidProperties.Count, oResult.MissingProperties.Count);
|
||||
|
||||
if (oResult.MissingProperties.Count > 0) {
|
||||
throw new ZUGFeRDExecption(ZUGFeRDInterface.ErrorType.MissingProperties,
|
||||
throw new ZUGFeRDExecption(ZUGFeRDInterface.ErrorType.MissingProperties,
|
||||
"Die hochgeladene Datei ist eine gültige ZUGFeRD-Rechnung, allerdings fehlen benötigte Daten.");
|
||||
}
|
||||
|
||||
string oMessage = "Die hochgeladene Datei ist eine gültige-ZUGFeRD Rechnung";
|
||||
|
||||
_logger.Debug($"Replying with: [{oMessage}]");
|
||||
|
||||
return new ValidationResponse()
|
||||
{
|
||||
status = RESPONSE_OK,
|
||||
message = "Die hochgeladene Datei ist eine gültige-ZUGFeRD Rechnung"
|
||||
message = oMessage
|
||||
};
|
||||
}
|
||||
catch (ZUGFeRDExecption ex)
|
||||
@@ -144,6 +149,8 @@ namespace ZUGFeRDRESTService.Controllers
|
||||
_ => new List<string>()
|
||||
};
|
||||
|
||||
_logger.Debug($"Replying with: [{oMessage}]");
|
||||
|
||||
return new ValidationResponse()
|
||||
{
|
||||
status = RESPONSE_ERROR,
|
||||
@@ -153,10 +160,15 @@ namespace ZUGFeRDRESTService.Controllers
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.Error(ex);
|
||||
|
||||
string oMessage = "Die hochgeladene Datei kann nicht validiert werden!";
|
||||
|
||||
_logger.Debug($"Replying with: [{oMessage}]");
|
||||
|
||||
return new ValidationResponse()
|
||||
{
|
||||
status = RESPONSE_ERROR,
|
||||
message = "Die hochgeladene Datei kann nicht validiert werden!"
|
||||
message = oMessage
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user