Path: blob/master/src/java.base/share/classes/java/security/GeneralSecurityException.java
41152 views
/*1* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package java.security;2627/**28* The {@code GeneralSecurityException} class is a generic29* security exception class that provides type safety for all the30* security-related exception classes that extend from it.31*32* @author Jan Luehe33* @since 1.234*/3536public class GeneralSecurityException extends Exception {3738@java.io.Serial39private static final long serialVersionUID = 894798122053539237L;4041/**42* Constructs a GeneralSecurityException with no detail message.43*/44public GeneralSecurityException() {45super();46}4748/**49* Constructs a GeneralSecurityException with the specified detail50* message.51* A detail message is a String that describes this particular52* exception.53*54* @param msg the detail message.55*/56public GeneralSecurityException(String msg) {57super(msg);58}5960/**61* Creates a {@code GeneralSecurityException} with the specified62* detail message and cause.63*64* @param message the detail message (which is saved for later retrieval65* by the {@link #getMessage()} method).66* @param cause the cause (which is saved for later retrieval by the67* {@link #getCause()} method). (A {@code null} value is permitted,68* and indicates that the cause is nonexistent or unknown.)69* @since 1.570*/71public GeneralSecurityException(String message, Throwable cause) {72super(message, cause);73}7475/**76* Creates a {@code GeneralSecurityException} with the specified cause77* and a detail message of {@code (cause==null ? null : cause.toString())}78* (which typically contains the class and detail message of79* {@code cause}).80*81* @param cause the cause (which is saved for later retrieval by the82* {@link #getCause()} method). (A {@code null} value is permitted,83* and indicates that the cause is nonexistent or unknown.)84* @since 1.585*/86public GeneralSecurityException(Throwable cause) {87super(cause);88}89}909192