Class RunBuildException

  • All Implemented Interfaces:
    Serializable

    public class RunBuildException
    extends Exception
    Special exception which we throw when we can somewhat explain the reason of the build failure.

    The message of this exception will be reported as error message in the build log. Cause exception (if presented) will be reported as well.

    Since 6.0 the client can also associate the error type. This allows the server to provide more data about the error occurred.

    See Also:
    Serialized Form
    • Constructor Detail

      • RunBuildException

        public RunBuildException​(String message)
        Parameters:
        message - log error message
      • RunBuildException

        public RunBuildException​(String message,
                                 Throwable cause)
        Parameters:
        message - log error message
        cause - original exception (logged with warning level)
      • RunBuildException

        public RunBuildException​(String message,
                                 Throwable cause,
                                 String errorType)
        Report the running build error with the error type specified.
        Parameters:
        message - log error message
        cause - original exception (logged with warning level)
        errorType - the error type, see ErrorData
      • RunBuildException

        public RunBuildException​(IOException cause)
        Report IO problem.
        Parameters:
        cause - original exception (logged with warning level)
      • RunBuildException

        public RunBuildException​(Throwable cause)
        Constructor for other types of underlying problems with no specific message
        Parameters:
        cause - original exception
    • Method Detail

      • isLogStacktrace

        public boolean isLogStacktrace()
        Returns:
        whether the stacktrace should appear in the build log when handling this exception. True by default.
      • setLogStacktrace

        public void setLogStacktrace​(boolean logStacktrace)
        Sets whether the stacktrace should appear in the build log when handling this exception. True by default.
        Parameters:
        logStacktrace - the flag value
      • getErrorType

        public String getErrorType()
        Returns the error type associated with this exception.
        Returns:
        error type
      • setErrorType

        public void setErrorType​(String errorType)
        Sets the error type for the this exception.
        Parameters:
        errorType - error type
      • copyParameters

        public void copyParameters​(@NotNull
                                   RunBuildException fromException)
        Copy all RunBuildException specific parameters to this instance of an exception. In current implementation it will copy isLogStacktrace() and getErrorType() fields. It is necessary to preserve those fields when re-throwing exceptions of this type to have errors reported.