View Javadoc
1   package ca.uhn.fhir.rest.server.exceptions;
2   
3   import org.hl7.fhir.instance.model.api.IBaseOperationOutcome;
4   
5   import ca.uhn.fhir.rest.api.Constants;
6   import ca.uhn.fhir.util.CoverageIgnore;
7   
8   /*
9    * #%L
10   * HAPI FHIR - Core Library
11   * %%
12   * Copyright (C) 2014 - 2019 University Health Network
13   * %%
14   * Licensed under the Apache License, Version 2.0 (the "License");
15   * you may not use this file except in compliance with the License.
16   * You may obtain a copy of the License at
17   * 
18   *      http://www.apache.org/licenses/LICENSE-2.0
19   * 
20   * Unless required by applicable law or agreed to in writing, software
21   * distributed under the License is distributed on an "AS IS" BASIS,
22   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23   * See the License for the specific language governing permissions and
24   * limitations under the License.
25   * #L%
26   */
27  
28  /**
29   * Represents an <b>HTTP 400 Bad Request</b> response.
30   * This status indicates that the client's message was invalid (e.g. not a valid FHIR Resource
31   * per the specifications), as opposed to the {@link UnprocessableEntityException} which indicates
32   * that data does not pass business rule validation on the server.
33   * 
34   * <p>
35   * Note that a complete list of RESTful exceptions is available in the
36   * <a href="./package-summary.html">Package Summary</a>.
37   * </p>
38   * 
39   * @see UnprocessableEntityException Which should be used for business level validation failures
40   */
41  @CoverageIgnore
42  public class InvalidRequestException extends BaseServerResponseException {
43  
44  	public static final int STATUS_CODE = Constants.STATUS_HTTP_400_BAD_REQUEST;
45  	private static final long serialVersionUID = 1L;
46  
47  	/**
48  	 * Constructor
49  	 */
50  	public InvalidRequestException(String theMessage) {
51  		super(STATUS_CODE, theMessage);
52  	}
53  
54  	/**
55  	 * Constructor
56  	 */
57  	public InvalidRequestException(String theMessage, Throwable theCause) {
58  		super(STATUS_CODE, theMessage, theCause);
59  	}
60  
61  	/**
62  	 * Constructor
63  	 */
64  	public InvalidRequestException(Throwable theCause) {
65  		super(STATUS_CODE, theCause);
66  	}
67  	
68  	/**
69  	 * Constructor
70  	 * 
71  	 * @param theMessage
72  	 *            The message
73  	 *  @param theOperationOutcome The OperationOutcome resource to return to the client
74  	 */
75  	public InvalidRequestException(String theMessage, IBaseOperationOutcome theOperationOutcome) {
76  		super(STATUS_CODE, theMessage, theOperationOutcome);
77  	}
78  
79  
80  }