Package com.atlassian.bamboo.repository
Class InvalidRepositoryException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- com.atlassian.bamboo.repository.RepositoryException
-
- com.atlassian.bamboo.repository.InvalidRepositoryException
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
InvalidStashRepositoryException
public class InvalidRepositoryException extends RepositoryException
An exception when the repository is invalid and should be handled- Since:
- v4.0
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringIGNORE_EXCEPTION_MESSAGEstatic StringPLAN_DISABLED_MESSAGE_FORMAT
-
Constructor Summary
Constructors Constructor Description InvalidRepositoryException(String message)InvalidRepositoryException(String message, String stdout, String stderr)InvalidRepositoryException(String message, Throwable cause)InvalidRepositoryException(String message, Throwable cause, String stdout, String stderr)InvalidRepositoryException(String message, Throwable cause, String stdout, String stderr, long repositoryId)
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanhandleInvalidRepositoryIfAppropriate(@Nullable PlanKey planKey, Throwable e, ErrorCollection errorCollection, com.atlassian.event.api.EventPublisher eventPublisher, @Nullable ErrorHandler errorHandler)Handles anInvalidRepositoryExceptionif appropriate, based on the exception type and theSystemProperty.PLAN_DISABLE_ON_REPOSITORY_EXCEPTIONsetting If the system property is true, the plan is disabled and an event published.-
Methods inherited from class com.atlassian.bamboo.repository.RepositoryException
getRepositoryId, getStderr, getStdout
-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Field Detail
-
IGNORE_EXCEPTION_MESSAGE
public static final String IGNORE_EXCEPTION_MESSAGE
- See Also:
- Constant Field Values
-
PLAN_DISABLED_MESSAGE_FORMAT
public static final String PLAN_DISABLED_MESSAGE_FORMAT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
InvalidRepositoryException
public InvalidRepositoryException(String message)
-
InvalidRepositoryException
public InvalidRepositoryException(String message, Throwable cause, String stdout, String stderr)
-
InvalidRepositoryException
public InvalidRepositoryException(String message, String stdout, String stderr)
-
-
Method Detail
-
handleInvalidRepositoryIfAppropriate
public static boolean handleInvalidRepositoryIfAppropriate(@Nullable @Nullable PlanKey planKey, Throwable e, ErrorCollection errorCollection, com.atlassian.event.api.EventPublisher eventPublisher, @Nullable @Nullable ErrorHandler errorHandler)Handles anInvalidRepositoryExceptionif appropriate, based on the exception type and theSystemProperty.PLAN_DISABLE_ON_REPOSITORY_EXCEPTIONsetting If the system property is true, the plan is disabled and an event published. If false, the exception is ignored, and a warning is logged, leaving the plan enabled.- Parameters:
planKey- the key of the plan being checkede- the exception to handleerrorCollection- a collection for error messageseventPublisher- publishes suspension eventserrorHandler- optional handler for recording errors- Returns:
- true if the exception was handled (plan suspended), false otherwise
-
-