1 package org.onap.sdc.workflow.services.errors;
4 import static org.springframework.http.HttpStatus.UNPROCESSABLE_ENTITY;
6 import org.springframework.web.bind.annotation.ResponseStatus;
8 @ResponseStatus(UNPROCESSABLE_ENTITY)
9 public class UniqueValueViolationException extends RuntimeException {
11 private static final String UNIQUE_VALUE_VIOLATION_MSG = "%s with the value '%s' already exists.";
13 public UniqueValueViolationException(String uniqueType, String value) {
14 super(String.format(UNIQUE_VALUE_VIOLATION_MSG, uniqueType, value));