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 * @version $Id: SerializationException.java 1436768 2013-01-22 07:07:42Z ggregory $ 027 */ 028public class SerializationException extends RuntimeException { 029 030 /** 031 * Required for serialization support. 032 * 033 * @see java.io.Serializable 034 */ 035 private static final long serialVersionUID = 4029025366392702726L; 036 037 /** 038 * <p>Constructs a new {@code SerializationException} without specified 039 * detail message.</p> 040 */ 041 public SerializationException() { 042 super(); 043 } 044 045 /** 046 * <p>Constructs a new {@code SerializationException} with specified 047 * detail message.</p> 048 * 049 * @param msg The error message. 050 */ 051 public SerializationException(final String msg) { 052 super(msg); 053 } 054 055 /** 056 * <p>Constructs a new {@code SerializationException} with specified 057 * nested {@code Throwable}.</p> 058 * 059 * @param cause The {@code Exception} or {@code Error} 060 * that caused this exception to be thrown. 061 */ 062 public SerializationException(final Throwable cause) { 063 super(cause); 064 } 065 066 /** 067 * <p>Constructs a new {@code SerializationException} with specified 068 * detail message and nested {@code Throwable}.</p> 069 * 070 * @param msg The error message. 071 * @param cause The {@code Exception} or {@code Error} 072 * that caused this exception to be thrown. 073 */ 074 public SerializationException(final String msg, final Throwable cause) { 075 super(msg, cause); 076 } 077 078}