001/* 002 * Copyright 2023 the original author or authors. 003 * <p> 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * <p> 008 * https://www.apache.org/licenses/LICENSE-2.0 009 * <p> 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package de.cuioss.tools.codec; 017 018/** 019 * Thrown when there is a failure condition during the decoding process. This 020 * exception is thrown when a Decoder encounters a decoding specific exception 021 * such as invalid data, or characters outside the expected range. 022 * 023 * @author https://github.com/apache/commons-codec/blob/master/src/main/java/org/apache/commons/codec/DecoderException.java 024 */ 025public class DecoderException extends Exception { 026 027 /** 028 * Declares the Serial Version Uid. 029 * 030 * @see <a href="http://c2.com/cgi/wiki?AlwaysDeclareSerialVersionUid">Always 031 * Declare Serial Version Uid</a> 032 */ 033 private static final long serialVersionUID = 1L; 034 035 /** 036 * Constructs a new exception with {@code null} as its detail message. The cause 037 * is not initialized, and may subsequently be initialized by a call to 038 * {@link #initCause}. 039 * 040 */ 041 public DecoderException() { 042 } 043 044 /** 045 * Constructs a new exception with the specified detail message. The cause is 046 * not initialized, and may subsequently be initialized by a call to 047 * {@link #initCause}. 048 * 049 * @param message The detail message which is saved for later retrieval by the 050 * {@link #getMessage()} method. 051 */ 052 public DecoderException(final String message) { 053 super(message); 054 } 055 056 /** 057 * Constructs a new exception with the specified detail message and cause. 058 * <p> 059 * Note that the detail message associated with {@code cause} is not 060 * automatically incorporated into this exception's detail message. 061 * 062 * @param message The detail message which is saved for later retrieval by the 063 * {@link #getMessage()} method. 064 * @param cause The cause which is saved for later retrieval by the 065 * {@link #getCause()} method. A {@code null} value is permitted, 066 * and indicates that the cause is nonexistent or unknown. 067 */ 068 public DecoderException(final String message, final Throwable cause) { 069 super(message, cause); 070 } 071 072 /** 073 * Constructs a new exception with the specified cause and a detail message of 074 * <code>(cause==null ? 075 * null : cause.toString())</code> (which typically contains the class and 076 * detail message of {@code cause}). This constructor is useful for exceptions 077 * that are little more than wrappers for other throwables. 078 * 079 * @param cause The cause which is saved for later retrieval by the 080 * {@link #getCause()} method. A {@code null} value is permitted, 081 * and indicates that the cause is nonexistent or unknown. 082 */ 083 public DecoderException(final Throwable cause) { 084 super(cause); 085 } 086}