1 /* 2 * Copyright (C) 2011 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package android.security; 18 19 /** 20 * Thrown on problems accessing the {@link KeyChain}. 21 */ 22 public class KeyChainException extends Exception { 23 24 /** 25 * Constructs a new {@code KeyChainException} that includes the 26 * current stack trace. 27 */ 28 public KeyChainException() { 29 } 30 31 /** 32 * Constructs a new {@code KeyChainException} with the current stack 33 * trace and the specified detail message. 34 * 35 * @param detailMessage 36 * the detail message for this exception. 37 */ 38 public KeyChainException(String detailMessage) { 39 super(detailMessage); 40 } 41 42 /** 43 * Constructs a new {@code KeyChainException} with the current stack 44 * trace, the specified detail message and the specified cause. 45 * 46 * @param message 47 * the detail message for this exception. 48 * @param cause 49 * the cause of this exception, may be {@code null}. 50 */ 51 public KeyChainException(String message, Throwable cause) { 52 super(message, cause); 53 } 54 55 /** 56 * Constructs a new {@code KeyChainException} with the current stack 57 * trace and the specified cause. 58 * 59 * @param cause 60 * the cause of this exception, may be {@code null}. 61 */ 62 public KeyChainException(Throwable cause) { 63 super((cause == null ? null : cause.toString()), cause); 64 } 65 } 66