Path: blob/master/src/java.base/share/classes/javax/net/ssl/SSLException.java
41159 views
/*1* Copyright (c) 1996, 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*/242526package javax.net.ssl;2728import java.io.IOException;2930/**31* Indicates some kind of error detected by an SSL subsystem.32* This class is the general class of exceptions produced33* by failed SSL-related operations.34*35* @since 1.436* @author David Brownell37*/38public39class SSLException extends IOException40{41@java.io.Serial42private static final long serialVersionUID = 4511006460650708967L;4344/**45* Constructs an exception reporting an error found by46* an SSL subsystem.47*48* @param reason describes the problem.49*/50public SSLException(String reason)51{52super(reason);53}5455/**56* Creates a {@code SSLException} with the specified57* detail message and cause.58*59* @param message the detail message (which is saved for later retrieval60* by the {@link #getMessage()} method).61* @param cause the cause (which is saved for later retrieval by the62* {@link #getCause()} method). (A {@code null} value is63* permitted, and indicates that the cause is nonexistent or64* unknown.)65* @since 1.566*/67public SSLException(String message, Throwable cause) {68super(message);69initCause(cause);70}7172/**73* Creates a {@code SSLException} with the specified cause74* and a detail message of {@code (cause==null ? null : cause.toString())}75* (which typically contains the class and detail message of76* {@code cause}).77*78* @param cause the cause (which is saved for later retrieval by the79* {@link #getCause()} method). (A {@code null} value is80* permitted, and indicates that the cause is nonexistent or81* unknown.)82* @since 1.583*/84public SSLException(Throwable cause) {85super(cause == null ? null : cause.toString());86initCause(cause);87}88}899091