diff options
Diffstat (limited to 'catalog-be/src/main/java/org/openecomp/sdc/be/servlets/exception/ConstraintViolationExceptionMapper.java')
-rw-r--r-- | catalog-be/src/main/java/org/openecomp/sdc/be/servlets/exception/ConstraintViolationExceptionMapper.java | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/exception/ConstraintViolationExceptionMapper.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/exception/ConstraintViolationExceptionMapper.java index 516ab5d85c..23c75a3989 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/exception/ConstraintViolationExceptionMapper.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/exception/ConstraintViolationExceptionMapper.java @@ -17,20 +17,18 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.servlets.exception; -import org.openecomp.sdc.be.config.ErrorInfo; -import org.springframework.stereotype.Component; +import static javax.ws.rs.core.Response.Status.BAD_REQUEST; +import java.util.Set; import javax.validation.ConstraintViolation; import javax.validation.ConstraintViolationException; import javax.ws.rs.core.Response; import javax.ws.rs.ext.ExceptionMapper; import javax.ws.rs.ext.Provider; -import java.util.Set; - -import static javax.ws.rs.core.Response.Status.BAD_REQUEST; +import org.openecomp.sdc.be.config.ErrorInfo; +import org.springframework.stereotype.Component; @Component @Provider @@ -42,8 +40,6 @@ public class ConstraintViolationExceptionMapper implements ExceptionMapper<Const ErrorInfo error = new ErrorInfo(); error.setCode(500); error.setMessage(constraintViolations.toString()); - return Response.status(BAD_REQUEST) - .entity(error) - .build(); + return Response.status(BAD_REQUEST).entity(error).build(); } } |