    001/*
    002 * Licensed to the Apache Software Foundation (ASF) under one or more
    003 * contributor license agreements.  See the NOTICE file distributed with
    004 * this work for additional information regarding copyright ownership.
    005 * The ASF licenses this file to You under the Apache License, Version 2.0
    006 * (the "License"); you may not use this file except in compliance with
    007 * the License.  You may obtain a copy of the License at
    008 *
    009 *      http://www.apache.org/licenses/LICENSE-2.0
    010 *
    011 * Unless required by applicable law or agreed to in writing, software
    012 * distributed under the License is distributed on an "AS IS" BASIS,
    013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    014 * See the License for the specific language governing permissions and
    015 * limitations under the License.
    016 */
    017package org.apache.commons.lang3;
    018
    019/**
    020 * <p>Exception thrown when the Serialization process fails.</p>
    021 *
    022 * <p>The original error is wrapped within this one.</p>
    023 *
    024 * <p>#NotThreadSafe# because Throwable is not thread-safe</p>
    025 * @since 1.0
    026 */
    027public class SerializationException extends RuntimeException {
    028
    029    /**
    030     * Required for serialization support.
    031     *
    032     * @see java.io.Serializable
    033     */
    034    private static final long serialVersionUID = 4029025366392702726L;
    035
    036    /**
    037     * <p>Constructs a new {@code SerializationException} without specified
    038     * detail message.</p>
    039     */
    040    public SerializationException() {
    041    }
    042
    043    /**
    044     * <p>Constructs a new {@code SerializationException} with specified
    045     * detail message.</p>
    046     *
    047     * @param msg  The error message.
    048     */
    049    public SerializationException(final String msg) {
    050        super(msg);
    051    }
    052
    053    /**
    054     * <p>Constructs a new {@code SerializationException} with specified
    055     * nested {@code Throwable}.</p>
    056     *
    057     * @param cause  The {@code Exception} or {@code Error}
    058     *  that caused this exception to be thrown.
    059     */
    060    public SerializationException(final Throwable cause) {
    061        super(cause);
    062    }
    063
    064    /**
    065     * <p>Constructs a new {@code SerializationException} with specified
    066     * detail message and nested {@code Throwable}.</p>
    067     *
    068     * @param msg    The error message.
    069     * @param cause  The {@code Exception} or {@code Error}
    070     *  that caused this exception to be thrown.
    071     */
    072    public SerializationException(final String msg, final Throwable cause) {
    073        super(msg, cause);
    074    }
    075
    076}