001package ca.uhn.fhir.rest.server.exceptions;
002
003import org.hl7.fhir.instance.model.api.IBaseOperationOutcome;
004
005import ca.uhn.fhir.rest.api.Constants;
006import ca.uhn.fhir.util.CoverageIgnore;
007
008/*
009 * #%L
010 * HAPI FHIR - Core Library
011 * %%
012 * Copyright (C) 2014 - 2021 Smile CDR, Inc.
013 * %%
014 * Licensed under the Apache License, Version 2.0 (the "License");
015 * you may not use this file except in compliance with the License.
016 * You may obtain a copy of the License at
017 *
018 *      http://www.apache.org/licenses/LICENSE-2.0
019 *
020 * Unless required by applicable law or agreed to in writing, software
021 * distributed under the License is distributed on an "AS IS" BASIS,
022 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
023 * See the License for the specific language governing permissions and
024 * limitations under the License.
025 * #L%
026 */
027
028/**
029 * Represents an <b>HTTP 500 Internal Error</b> response.
030 * This status indicates that the server failed to successfully process the
031 * request. This generally means that the server is misbehaving or is
032 * misconfigured in some way, although a misbehaving server might also
033 * send this status code in the case of a bad request message (although it
034 * should not do this; an HTTP 4xx response is more appropriate in that
035 * situation).
036 * 
037 * <p>
038 * Note that a complete list of RESTful exceptions is available in the
039 * <a href="./package-summary.html">Package Summary</a>.
040 * </p>
041 * 
042 * @see UnprocessableEntityException Which should be used for business level validation failures
043 */
044@CoverageIgnore
045public class InternalErrorException extends BaseServerResponseException {
046
047        public static final int STATUS_CODE = Constants.STATUS_HTTP_500_INTERNAL_ERROR;
048        
049        private static final long serialVersionUID = 1L;
050
051        /**
052         * Constructor
053         * 
054         * @param theMessage
055         *            The message
056         *  @param theOperationOutcome The OperationOutcome resource to return to the client
057         */
058        public InternalErrorException(String theMessage, IBaseOperationOutcome theOperationOutcome) {
059                super(STATUS_CODE, theMessage, theOperationOutcome);
060        }
061
062        public InternalErrorException(String theMessage) {
063                super(STATUS_CODE, theMessage);
064        }
065
066        public InternalErrorException(String theMessage, Throwable theCause) {
067                super(STATUS_CODE, theMessage, theCause);
068        }
069
070        public InternalErrorException(Throwable theCause) {
071                super(STATUS_CODE, theCause);
072        }
073
074}