Class BaseOutput

  • Direct Known Subclasses:
    AskOutput, ListModelsOutput, TestConnectionOutput

    public abstract class BaseOutput
    extends Object
    Base class for outputs from API calls, with the ability to represent errors. Subclasses should add specific fields for successful outputs.
    Since:
    8.5.0
    • Method Detail

      • errorCause

        public final Throwable errorCause()
        Gets the exception that caused the error, if there was an error.
        Returns:
        The exception, or null if synthesis was successful.
      • errorMessage

        public final String errorMessage()
        Gets the error message, if there was an error.
        Returns:
        The error message, or null if synthesis was successful.
      • errorType

        public final GenericOaiErrorType errorType()
        Gets the type of error, if there was an error.
        Returns:
        The error type, or null if synthesis was successful.
      • hasError

        public final boolean hasError()
        Checks if the output represents an error.
        Returns:
        true if there was an error, false otherwise.