diff --git a/cwms-data-api/src/main/java/cwms/cda/api/LocationGroupController.java b/cwms-data-api/src/main/java/cwms/cda/api/LocationGroupController.java index e2f292dac..9acf4e1c6 100644 --- a/cwms-data-api/src/main/java/cwms/cda/api/LocationGroupController.java +++ b/cwms-data-api/src/main/java/cwms/cda/api/LocationGroupController.java @@ -227,9 +227,8 @@ public void create(@NotNull Context ctx) { if (!deserialize.getLocationCategory().getOfficeId().equalsIgnoreCase(CWMS_OFFICE) && (!deserialize.getOfficeId().equalsIgnoreCase(deserialize.getLocationCategory().getOfficeId()) || deserialize.getOfficeId().equalsIgnoreCase(CWMS_OFFICE))) { - CdaError re = new CdaError("Location Group office ID cannot be CWMS and must match the " - + "Location Category office ID"); - throw new IllegalArgumentException(re.toString()); + throw new IllegalArgumentException("Location Group office ID cannot be CWMS and must match the " + + "Location Category office ID"); } LocationGroupDao dao = new LocationGroupDao(dsl); diff --git a/cwms-data-api/src/main/java/cwms/cda/api/TimeSeriesGroupController.java b/cwms-data-api/src/main/java/cwms/cda/api/TimeSeriesGroupController.java index 91606e973..eb06d9f33 100644 --- a/cwms-data-api/src/main/java/cwms/cda/api/TimeSeriesGroupController.java +++ b/cwms-data-api/src/main/java/cwms/cda/api/TimeSeriesGroupController.java @@ -258,9 +258,8 @@ public void create(@NotNull Context ctx) { if (!deserialize.getTimeSeriesCategory().getOfficeId().equalsIgnoreCase(CWMS_OFFICE) && (!deserialize.getOfficeId().equalsIgnoreCase(deserialize.getTimeSeriesCategory().getOfficeId()) || deserialize.getOfficeId().equalsIgnoreCase(CWMS_OFFICE))) { - CdaError re = new CdaError("TimeSeries Group office ID cannot be CWMS and must match the " + throw new IllegalArgumentException("TimeSeries Group office ID cannot be CWMS and must match the " + "TimeSeries Category office ID"); - throw new IllegalArgumentException(re.toString()); } boolean failIfExists = ctx.queryParamAsClass(FAIL_IF_EXISTS, Boolean.class).getOrDefault(true);