Enum ExitCode

  • All Implemented Interfaces:
    Serializable, Comparable<ExitCode>

    public enum ExitCode
    extends Enum<ExitCode>
    ExitCode class defines Buck binary protocol, i.e. exit codes that Buck can report to a running shell. In addition to exit codes defined below, we have to honor following conventions.

    Buck bootstrapper must conform to the protocol, i.e. properly implement FATAL_BOOTSTRAP

    Exit codes for interrupts do follow POSIX convention, i.e. 128 + SIGNAL_CODE, i.e SIGINT is returned as 128 + 2 = 130

    Exit codes 1-9 are reserved for non-fatal errors, like build errors

    Exit codes 10-19 are reserved for fatal errors, like unexpected runtime exceptions

    Binary protocol is open to extension but closed to modification.

    • Enum Constant Detail

      • SUCCESS

        public static final ExitCode SUCCESS
        Buck command completed successfully
      • BUILD_ERROR

        public static final ExitCode BUILD_ERROR
        Build resulted in user-specific error
      • BUSY

        public static final ExitCode BUSY
        Buck daemon is busy processing another command
      • COMMANDLINE_ERROR

        public static final ExitCode COMMANDLINE_ERROR
        User supplied incorrect command line options
      • NOTHING_TO_DO

        public static final ExitCode NOTHING_TO_DO
        There is nothing to build or evaluate for the command
      • PARSE_ERROR

        public static final ExitCode PARSE_ERROR
        There was build file parsing or graph construction error
      • RUN_ERROR

        public static final ExitCode RUN_ERROR
        Running a binary or installing binary to a device has failed
      • FATAL_GENERIC

        public static final ExitCode FATAL_GENERIC
        Generic Buck-internal non-recoverable error
      • FATAL_BOOTSTRAP

        public static final ExitCode FATAL_BOOTSTRAP
        Non-recoverable error in Buck bootstrapper
      • FATAL_OOM

        public static final ExitCode FATAL_OOM
        Non-recoverable OutOfMemory error
      • FATAL_IO

        public static final ExitCode FATAL_IO
        Non-recoverable generic I/0 error
      • FATAL_DISK_FULL

        public static final ExitCode FATAL_DISK_FULL
        No space on device
      • FIX_FAILED

        public static final ExitCode FIX_FAILED
        Indicates that the buck fix script returned a non-zero exit
      • TEST_ERROR

        public static final ExitCode TEST_ERROR
        Test run had user-specific test errors
      • TEST_NOTHING

        public static final ExitCode TEST_NOTHING
        There was no tests found to run
      • SIGNAL_INTERRUPT

        public static final ExitCode SIGNAL_INTERRUPT
        Command was interrupted (Ctrl + C)
    • Method Detail

      • values

        public static ExitCode[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (ExitCode c : ExitCode.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static ExitCode valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • getCode

        public int getCode()
        Returns:
        integer value of the exit code
      • isFatal

        public boolean isFatal()
        Returns:
        true if error is Buck internal non-recoverable failure
      • map

        public static ExitCode map​(int code)
        Map integer value received from custom toolchain subcall to one of appropriate ExitCode values. This function is for backwards compatibility only, please construct ExitCode directly instead