Class Exceptions

java.lang.Object
dev.langchain4j.internal.Exceptions

public class Exceptions extends Object
Utility methods for creating common exceptions.
  • Method Details

    • illegalArgument

      public static IllegalArgumentException illegalArgument(String format, Object... args)
      Constructs an IllegalArgumentException with the given formatted result.

      Equivalent to new IllegalArgumentException(String.format(format, args)).

      Parameters:
      format - the format string
      args - the format arguments
      Returns:
      the constructed exception.
    • runtime

      public static RuntimeException runtime(String format, Object... args)
      Constructs an RuntimeException with the given formatted result.

      Equivalent to new RuntimeException(String.format(format, args)).

      Parameters:
      format - the format string
      args - the format arguments
      Returns:
      the constructed exception.