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 - 2018 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  	public InvalidRequestException(String theMessage) {
48  		super(STATUS_CODE, theMessage);
49  	}
50  
51  	public InvalidRequestException(Throwable theCause) {
52  		super(STATUS_CODE, theCause);
53  	}
54  	
55  	/**
56  	 * Constructor
57  	 * 
58  	 * @param theMessage
59  	 *            The message
60  	 *  @param theOperationOutcome The OperationOutcome resource to return to the client
61  	 */
62  	public InvalidRequestException(String theMessage, IBaseOperationOutcome theOperationOutcome) {
63  		super(STATUS_CODE, theMessage, theOperationOutcome);
64  	}
65  
66  
67  }