Class UserError

All Implemented Interfaces:
Serializable

public class UserError extends RuntimeException
Exception type indicating a mistake by an end user in using the Checker Framework, such as incorrect command-line arguments.

To indicate a bug in the framework, use BugInCF. To indicate a bug in a checker implementation, use TypeSystemError.

See Also:
  • Constructor Details

    • UserError

      public UserError(String message)
      Constructs a new CheckerError with the specified detail message.
      Parameters:
      message - the detail message
    • UserError

      @FormatMethod public UserError(String fmt, @Nullable Object... args)
      Constructs a new CheckerError with a detail message composed from the given arguments.

      Beware: if the only argument is a Throwable, then Java instead selects UserError(String, Throwable), which uses fmt literally rather than as a format string, and uses the throwable as the cause. To format a throwable into the detail message, pass it as an explicit cause too, as in new UserError(t, "Cannot read %s", t), or pass t.getMessage() as the format argument.

      Parameters:
      fmt - the format string
      args - the arguments for the format string
    • UserError

      public UserError(String message, Throwable cause)
      Constructs a new CheckerError with the specified detail message and cause.
      Parameters:
      message - the detail message
      cause - the cause
    • UserError

      @FormatMethod public UserError(Throwable cause, String fmt, @Nullable Object... args)
      Constructs a new CheckerError with the specified cause and with a detail message composed from the given arguments.
      Parameters:
      cause - the cause
      fmt - the format string
      args - the arguments for the format string