# Class InferenceException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.codename1.ai.inference.InferenceException

public class InferenceException extends RuntimeException
Reports model validation, delegate selection, allocation, or invocation failures from the portable inference API.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `InferenceException(String message)`
  Creates an inference failure with a user-readable explanation.
  `InferenceException(String message, Throwable cause)`
  Creates an inference failure that preserves the native/port cause.

- ## Method Summary

  ### Methods inherited from class Throwable

  `addSuppressed, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, setStackTrace, toString`

  ### Methods inherited from class Object

  `clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### InferenceException

    public InferenceException(String message)
    Creates an inference failure with a user-readable explanation.
    Parameters:
      `message` - failure explanation

  - ### InferenceException

    public InferenceException(String message, Throwable cause)
    Creates an inference failure that preserves the native/port cause.
    Parameters:
      `message` - failure explanation
      `cause` - originating error