Java codec exceptions
CodecException is the exception class that should be thrown by a codec plug-in whenever the one of its methods is called and an error prevents the method from successfully completing — for example, a message that cannot be encoded or decoded because it has an invalid format.
A CodecException object always has an associated message, which is a String explaining the problem (this may include information about another exception that caused the CodecException to be thrown). There is also a code field that specifies the kind of error that occurred; the possible codes are defined as constants in the CodecException class.
Like the TransportException object, CodecException defines a number of constructors, to make it easy to set up the exception's information quickly in different situations.
See the
CodecException class in the
API Reference for Java (Javadoc) for more information on these constants and constructors.