358863e969f1cbbe0c4f0d994e765f0a8c7443af
[sdc/sdc-workflow-designer.git] /
1 package org.onap.sdc.workflow.services.errors;
2
3
4 import static org.springframework.http.HttpStatus.UNPROCESSABLE_ENTITY;
5
6 import org.springframework.web.bind.annotation.ResponseStatus;
7
8 @ResponseStatus(UNPROCESSABLE_ENTITY)
9 public class UniqueValueViolationException extends RuntimeException {
10
11     private static final String UNIQUE_VALUE_VIOLATION_MSG = "%s with the value '%s' already exists.";
12
13     public UniqueValueViolationException(String uniqueType, String value) {
14         super(String.format(UNIQUE_VALUE_VIOLATION_MSG, uniqueType, value));
15     }
16 }