diff options
Diffstat (limited to 'cmso-service/src/main/java/org/onap')
-rw-r--r-- | cmso-service/src/main/java/org/onap/optf/cmso/service/rs/CmQueryParameters.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/CmQueryParameters.java b/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/CmQueryParameters.java index 442abe3..1e4a46a 100644 --- a/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/CmQueryParameters.java +++ b/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/CmQueryParameters.java @@ -223,11 +223,13 @@ public class CmQueryParameters { }
private static DateTime convertDate(String utcDate, String urlName) throws CmsoException {
- DateTime dateTime = ISODateTimeFormat.dateTimeParser().parseDateTime(utcDate);
- if (dateTime != null) {
+ try {
+ DateTime dateTime = ISODateTimeFormat.dateTimeParser().parseDateTime(utcDate);
return dateTime;
}
- throw new CmsoException(Status.BAD_REQUEST, LogMessages.INVALID_DATE_FILTER, urlName, utcDate);
+ catch (Exception e) {
+ throw new CmsoException(Status.BAD_REQUEST, LogMessages.INVALID_DATE_FILTER, urlName, utcDate);
+ }
}
// public static void main(String argv[])
|