Skip to content
Snippets Groups Projects
Commit c7b4f25e authored by Tucker Gary Siegel's avatar Tucker Gary Siegel
Browse files

handle differently

parent fd37b6f3
No related branches found
No related tags found
1 merge request!3handle differently
......@@ -55,10 +55,9 @@ public class CustomExceptionHandler {
@ExceptionHandler(BindException.class)
protected ResponseEntity<Object> handleBindException(BindException ex, WebRequest request) {
DawnException wrapped = new DawnException(BaseExceptions.BAD_REQUEST, ex);
FieldError err = ex.getFieldError();
wrapped.setDescription("Value " + err.getRejectedValue() + " is invalid for field " + err.getField());
DawnException wrapped = new DawnException(BaseExceptions.BAD_REQUEST, ex, "Value " + err.getRejectedValue() + " is invalid for field " + err.getField());
return returnDawnException(wrapped);
}
......
......@@ -22,6 +22,12 @@ public class DawnException extends RuntimeException {
base = baseException;
}
public DawnException(DawnExceptionParameters parameters, Exception baseException, String description) {
this(parameters);
base = baseException;
this.description = description;
}
@Override
public String getMessage() {
return description;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment