001package io.cui.tools.codec; 002 003/** 004 * Thrown when there is a failure condition during the encoding process. This exception is thrown 005 * when an Encoder encounters an encoding specific exception such as invalid data, inability to 006 * calculate a checksum, characters outside the expected range. 007 * 008 * @author https://github.com/apache/commons-codec/blob/master/src/main/java/org/apache/commons/codec/EncoderException.java 009 */ 010public class EncoderException extends Exception { 011 012 /** 013 * Declares the Serial Version Uid. 014 * 015 * @see <a href="http://c2.com/cgi/wiki?AlwaysDeclareSerialVersionUid">Always Declare Serial 016 * Version Uid</a> 017 */ 018 private static final long serialVersionUID = 1L; 019 020 /** 021 * Constructs a new exception with {@code null} as its detail message. The cause is not 022 * initialized, and may subsequently be initialized by a call to {@link #initCause}. 023 */ 024 public EncoderException() { 025 super(); 026 } 027 028 /** 029 * Constructs a new exception with the specified detail message. The cause is not initialized, 030 * and may subsequently be initialized by a call to {@link #initCause}. 031 * 032 * @param message 033 * a useful message relating to the encoder specific error. 034 */ 035 public EncoderException(final String message) { 036 super(message); 037 } 038 039 /** 040 * Constructs a new exception with the specified detail message and cause. 041 * 042 * <p> 043 * Note that the detail message associated with {@code cause} is not automatically incorporated 044 * into this 045 * exception's detail message. 046 * </p> 047 * 048 * @param message 049 * The detail message which is saved for later retrieval by the {@link #getMessage()} 050 * method. 051 * @param cause 052 * The cause which is saved for later retrieval by the {@link #getCause()} method. A 053 * {@code null} value is permitted, and indicates that the cause is nonexistent or 054 * unknown. 055 */ 056 public EncoderException(final String message, final Throwable cause) { 057 super(message, cause); 058 } 059 060 /** 061 * Constructs a new exception with the specified cause and a detail message of 062 * <code>(cause==null ? 063 * null : cause.toString())</code> (which typically contains the class and detail message of 064 * {@code cause}). 065 * This constructor is useful for exceptions that are little more than wrappers for other 066 * throwables. 067 * 068 * @param cause 069 * The cause which is saved for later retrieval by the {@link #getCause()} method. A 070 * {@code null} value is permitted, and indicates that the cause is nonexistent or 071 * unknown. 072 */ 073 public EncoderException(final Throwable cause) { 074 super(cause); 075 } 076}