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