Added key on log when a validation fails

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/accounting/accounting-lib@117185 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Luca Frosini 2015-07-13 13:12:21 +00:00
parent 16c90b7ab7
commit 9e971f5967
1 changed files with 6 additions and 1 deletions

View File

@ -398,7 +398,12 @@ public abstract class BasicUsageRecord implements UsageRecord, Serializable {
logger.debug("{} is a computed field. To be calculated all the required fields to calcutalate it MUST be set. "
+ "In any case the provided value is ignored.");
}
checkedValue = fieldValidator.validate(key, checkedValue, this);
try {
checkedValue = fieldValidator.validate(key, checkedValue, this);
} catch (InvalidValueException e) {
logger.error(String.format("The provided value %s is NOT valid for field with key %s.", checkedValue.toString(), key));
throw e;
}
}
}
return checkedValue;