View Javadoc
1   package de.dlr.shepard.exceptions;
2   
3   import jakarta.ws.rs.core.Response.Status;
4   
5   /**
6    * InvalidBodyException implements an exception. This exception should be thrown
7    * if a value in the JSON Request Body doesn't fulfill the necessary constraints
8    * of an attribute. When a InvalidBodyException is thrown a Bad Request (status
9    * code 400) does get sent with a message informing the client about the
10   * specific error.
11   **/
12  public class InvalidBodyException extends ShepardException {
13  
14    private static final long serialVersionUID = 8918170154141864994L;
15    private static final Status status = Status.BAD_REQUEST;
16  
17    public InvalidBodyException() {
18      super("Some of the values provided in the JSON Body are incorrect", status);
19    }
20  
21    public InvalidBodyException(String message) {
22      super(message, status);
23    }
24  
25    public InvalidBodyException(String format, Object... args) {
26      super(String.format(format, args), status);
27    }
28  }