Class TLcdModelDecodeException

All Implemented Interfaces:
Serializable

public class TLcdModelDecodeException extends IOException
An IOException subclass that provides structured information about why an ILcdModelDecoder.decode(String) call failed.

The category allows callers to distinguish between different types of failures (e.g. unsupported version vs. malformed content) and respond appropriately.

Decoder implementations may throw this exception, but are not required to — throwing a plain IOException remains valid.

Usage example


 ILcdModelDecoder decoder = ...;
 try {
   ILcdModel model = decoder.decode(sourceName);
 } catch (TLcdModelDecodeException e) {
   switch (e.getCategory()) {
     case SOURCE_NOT_AVAILABLE:
       showError("Cannot open " + sourceName + ": " + e.getMessage());
       break;
     case UNSUPPORTED_FORMAT:
       showError("Unrecognized file format: " + e.getMessage());
       break;
     case UNSUPPORTED_VERSION:
       showError("Unsupported format version: " + e.getMessage());
       break;
     case MALFORMED_CONTENT:
     case INVALID_CONTENT:
       showError("Cannot decode file contents: " + e.getMessage());
       break;
     default:
       showError("Decode failed: " + e.getMessage());
       break;
   }
 } catch (IOException e) {
   // Fallback for decoders that do not throw TLcdModelDecodeException.
   showError("Decode failed: " + e.getMessage());
 }
 
Since:
2026.0.11
See Also:
  • Constructor Details

    • TLcdModelDecodeException

      public TLcdModelDecodeException(TLcdModelDecodeException.Category aCategory)
      Creates a new exception with the given category and no detail message.
      Parameters:
      aCategory - the failure category, must not be null.
    • TLcdModelDecodeException

      public TLcdModelDecodeException(TLcdModelDecodeException.Category aCategory, String aMessage)
      Creates a new exception with the given category and detail message.
      Parameters:
      aCategory - the failure category, must not be null.
      aMessage - a human-readable description of the failure, or null.
    • TLcdModelDecodeException

      public TLcdModelDecodeException(TLcdModelDecodeException.Category aCategory, String aMessage, Throwable aCause)
      Creates a new exception with the given category, detail message, and cause.
      Parameters:
      aCategory - the failure category, must not be null.
      aMessage - a human-readable description of the failure, or null.
      aCause - the underlying cause, or null if unknown.
    • TLcdModelDecodeException

      public TLcdModelDecodeException(TLcdModelDecodeException.Category aCategory, Throwable aCause)
      Creates a new exception with the given category and cause. The detail message is derived from the cause.
      Parameters:
      aCategory - the failure category, must not be null.
      aCause - the underlying cause, or null if unknown.
  • Method Details