TSK-590 Add more descriptive error message on service level error.

- Error message on validating service level is more descriptive adding some examples of how to use the ISO-8601 format.
This commit is contained in:
Martin Rojas Miguel Angel 2018-07-11 12:41:34 +02:00 committed by Holger Hagen
parent 84b681d442
commit bc317b6c72
1 changed files with 3 additions and 1 deletions

View File

@ -266,7 +266,9 @@ public class ClassificationServiceImpl implements ClassificationService {
try {
Duration.parse(classification.getServiceLevel());
} catch (Exception e) {
throw new InvalidArgumentException("Invalid service level. Please use the format defined by ISO 8601",
throw new InvalidArgumentException("Invalid service level. Please use the format defined by ISO 8601. "
+ "For example: \"P2D\" represents a period of \"two days.\" "
+ "Or \"P2DT6H\" represents a period of \"two days and six hours.\"",
e.getCause());
}
}