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
An exception when the repository is invalid and should be handled
- Since:
- v4.0
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionInvalidRepositoryException
(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
Modifier and TypeMethodDescriptionstatic boolean
handleInvalidRepositoryIfAppropriate
(@Nullable PlanKey planKey, Throwable e, ErrorCollection errorCollection, com.atlassian.event.api.EventPublisher eventPublisher, @Nullable ErrorHandler errorHandler) Handles anInvalidRepositoryException
if appropriate, based on the exception type and theSystemProperty.PLAN_DISABLE_ON_REPOSITORY_EXCEPTION
setting 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 Details
-
IGNORE_EXCEPTION_MESSAGE
- See Also:
-
PLAN_DISABLED_MESSAGE_FORMAT
- See Also:
-
-
Constructor Details
-
InvalidRepositoryException
-
InvalidRepositoryException
-
InvalidRepositoryException
-
InvalidRepositoryException
-
InvalidRepositoryException
-
-
Method Details
-
handleInvalidRepositoryIfAppropriate
public static boolean handleInvalidRepositoryIfAppropriate(@Nullable @Nullable PlanKey planKey, Throwable e, ErrorCollection errorCollection, com.atlassian.event.api.EventPublisher eventPublisher, @Nullable @Nullable ErrorHandler errorHandler) Handles anInvalidRepositoryException
if appropriate, based on the exception type and theSystemProperty.PLAN_DISABLE_ON_REPOSITORY_EXCEPTION
setting 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
-