Package jetbrains.buildServer
Class RunBuildException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- jetbrains.buildServer.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 Summary
Constructors Constructor Description RunBuildException(IOException cause)
Report IO problem.RunBuildException(String message)
RunBuildException(String message, Throwable cause)
RunBuildException(String message, Throwable cause, String errorType)
Report the running build error with the error type specified.RunBuildException(Throwable cause)
Constructor for other types of underlying problems with no specific message
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
copyParameters(RunBuildException fromException)
Copy all RunBuildException specific parameters to this instance of an exception.static RunBuildException
create(ProcessNotCreatedException source, String commandLine)
String
getErrorType()
Returns the error type associated with this exception.boolean
isLogStacktrace()
void
setErrorType(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
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
RunBuildException
public RunBuildException(String message)
- Parameters:
message
- log error message
-
RunBuildException
public RunBuildException(String message, Throwable cause)
- Parameters:
message
- log error messagecause
- 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 messagecause
- original exception (logged with warning level)errorType
- the error type, seeErrorData
-
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 copyisLogStacktrace()
andgetErrorType()
fields. It is necessary to preserve those fields when re-throwing exceptions of this type to have errors reported.
-
create
public static RunBuildException create(ProcessNotCreatedException source, String commandLine)
-
-