1 /*
2  * Copyright (c) 1996, 2004, Oracle and/or its affiliates. All rights reserved.
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * This code is free software; you can redistribute it and/or modify it
6  * under the terms of the GNU General Public License version 2 only, as
7  * published by the Free Software Foundation.  Oracle designates this
8  * particular file as subject to the "Classpath" exception as provided
9  * by Oracle in the LICENSE file that accompanied this code.
10  *
11  * This code is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14  * version 2 for more details (a copy is included in the LICENSE file that
15  * accompanied this code).
16  *
17  * You should have received a copy of the GNU General Public License version
18  * 2 along with this work; if not, write to the Free Software Foundation,
19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20  *
21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22  * or visit www.oracle.com if you need additional information or have any
23  * questions.
24  */
25 
26 
27 package javax.net.ssl;
28 
29 import java.io.IOException;
30 
31 /**
32  * Indicates some kind of error detected by an SSL subsystem.
33  * This class is the general class of exceptions produced
34  * by failed SSL-related operations.
35  *
36  * @since 1.4
37  * @author David Brownell
38  */
39 public
40 class SSLException extends IOException
41 {
42     private static final long serialVersionUID = 4511006460650708967L;
43 
44     /**
45      * Constructs an exception reporting an error found by
46      * an SSL subsystem.
47      *
48      * @param reason describes the problem.
49      */
SSLException(String reason)50     public SSLException(String reason)
51     {
52         super(reason);
53     }
54 
55     /**
56      * Creates a <code>SSLException</code> with the specified
57      * detail message and cause.
58      *
59      * @param message the detail message (which is saved for later retrieval
60      *          by the {@link #getMessage()} method).
61      * @param cause the cause (which is saved for later retrieval by the
62      *          {@link #getCause()} method).  (A <tt>null</tt> value is
63      *          permitted, and indicates that the cause is nonexistent or
64      *          unknown.)
65      * @since 1.5
66      */
SSLException(String message, Throwable cause)67     public SSLException(String message, Throwable cause) {
68         super(message);
69         initCause(cause);
70     }
71 
72     /**
73      * Creates a <code>SSLException</code> with the specified cause
74      * and a detail message of <tt>(cause==null ? null : cause.toString())</tt>
75      * (which typically contains the class and detail message of
76      * <tt>cause</tt>).
77      *
78      * @param cause the cause (which is saved for later retrieval by the
79      *          {@link #getCause()} method).  (A <tt>null</tt> value is
80      *          permitted, and indicates that the cause is nonexistent or
81      *          unknown.)
82      * @since 1.5
83      */
SSLException(Throwable cause)84     public SSLException(Throwable cause) {
85         super(cause == null ? null : cause.toString());
86         initCause(cause);
87     }
88 }
89