jetbrains.buildServer
Class RunBuildException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by jetbrains.buildServer.RunBuildException
All Implemented Interfaces:
java.io.Serializable

public class RunBuildException
extends java.lang.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 Summary
RunBuildException(java.io.IOException cause)
          Report IO problem.
RunBuildException(java.lang.String message)
           
RunBuildException(java.lang.String message, java.lang.Throwable cause)
           
RunBuildException(java.lang.String message, java.lang.Throwable cause, java.lang.String errorType)
          Report the running build error with the error type specified.
RunBuildException(java.lang.Throwable cause)
          Constructor for other types of underlying problems with no specific message
 
Method Summary
 void copyParameters(RunBuildException fromException)
          Copy all RunBuildException specific parameters to this instance of an exception.
static RunBuildException create(com.intellij.execution.process.ProcessNotCreatedException source, java.lang.String commandLine)
           
 java.lang.String getErrorType()
          Returns the error type associated with this exception.
 boolean isLogStacktrace()
           
 void setErrorType(java.lang.String errorType)
          Sets the error type for the this exception.
 void setLogStacktrace(boolean logStacktrace)
          Sets whether the stacktrace should appear in the build log when handling this exception.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RunBuildException

public RunBuildException(java.lang.String message)
Parameters:
message - log error message

RunBuildException

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

RunBuildException

public RunBuildException(java.lang.String message,
                         java.lang.Throwable cause,
                         java.lang.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(java.io.IOException cause)
Report IO problem.

Parameters:
cause - original exception (logged with warning level)

RunBuildException

public RunBuildException(java.lang.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 java.lang.String getErrorType()
Returns the error type associated with this exception.

Returns:
error type

setErrorType

public void setErrorType(java.lang.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.


create

public static RunBuildException create(com.intellij.execution.process.ProcessNotCreatedException source,
                                       java.lang.String commandLine)