001package ca.uhn.fhir.rest.server.exceptions; 002 003import ca.uhn.fhir.rest.server.Constants; 004import ca.uhn.fhir.util.CoverageIgnore; 005 006/* 007 * #%L 008 * HAPI FHIR - Core Library 009 * %% 010 * Copyright (C) 2014 - 2016 University Health Network 011 * %% 012 * Licensed under the Apache License, Version 2.0 (the "License"); 013 * you may not use this file except in compliance with the License. 014 * You may obtain a copy of the License at 015 * 016 * http://www.apache.org/licenses/LICENSE-2.0 017 * 018 * Unless required by applicable law or agreed to in writing, software 019 * distributed under the License is distributed on an "AS IS" BASIS, 020 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 021 * See the License for the specific language governing permissions and 022 * limitations under the License. 023 * #L% 024 */ 025 026/** 027 * Represents an <b>HTTP 401 Client Unauthorized</b> response, which means that the client needs to provide credentials, or has provided invalid credentials. 028 */ 029@CoverageIgnore 030public class AuthenticationException extends BaseServerResponseException { 031 032 public static final int STATUS_CODE = Constants.STATUS_HTTP_401_CLIENT_UNAUTHORIZED; 033 034 private static final long serialVersionUID = 1L; 035 036 public AuthenticationException() { 037 super(STATUS_CODE, "Client unauthorized"); 038 } 039 040 public AuthenticationException(String theMessage) { 041 super(STATUS_CODE, theMessage); 042 } 043 044 public AuthenticationException(String theMessage, Throwable theCause) { 045 super(STATUS_CODE, theMessage, theCause); 046 } 047 048}