View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    *
9    *      https://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  package org.apache.commons.lang3;
18  
19  /**
20   * Exception thrown when the Serialization process fails.
21   *
22   * <p>The original error is wrapped within this one.</p>
23   *
24   * <p>#NotThreadSafe# because Throwable is not thread-safe</p>
25   *
26   * @since 1.0
27   */
28  public class SerializationException extends RuntimeException {
29  
30      /**
31       * Required for serialization support.
32       *
33       * @see java.io.Serializable
34       */
35      private static final long serialVersionUID = 4029025366392702726L;
36  
37      /**
38       * Constructs a new {@link SerializationException} without specified
39       * detail message.
40       */
41      public SerializationException() {
42      }
43  
44      /**
45       * Constructs a new {@link SerializationException} with specified
46       * detail message.
47       *
48       * @param msg  The error message.
49       */
50      public SerializationException(final String msg) {
51          super(msg);
52      }
53  
54      /**
55       * Constructs a new {@link SerializationException} with specified
56       * detail message and nested {@link Throwable}.
57       *
58       * @param msg    The error message.
59       * @param cause  The {@link Exception} or {@link Error}
60       *  that caused this exception to be thrown.
61       */
62      public SerializationException(final String msg, final Throwable cause) {
63          super(msg, cause);
64      }
65  
66      /**
67       * Constructs a new {@link SerializationException} with specified
68       * nested {@link Throwable}.
69       *
70       * @param cause  The {@link Exception} or {@link Error}
71       *  that caused this exception to be thrown.
72       */
73      public SerializationException(final Throwable cause) {
74          super(cause);
75      }
76  
77  }