Package com.atlassian.bamboo.logger
Class DefaultErrorHandler
java.lang.Object
com.atlassian.bamboo.logger.AbstractErrorUpdateHandler
com.atlassian.bamboo.logger.DefaultErrorHandler
- All Implemented Interfaces:
ErrorAccessor
,ErrorHandler
,ErrorUpdateHandler
This class keeps track of Bamboo build errors so they can get reported to the user.
-
Field Summary
Fields inherited from class com.atlassian.bamboo.logger.AbstractErrorUpdateHandler
agentContext
-
Constructor Summary
ConstructorDescriptionDefaultErrorHandler
(AgentContext agentContext, com.atlassian.event.api.EventPublisher eventPublisher) -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Remove all errors from the handlervoid
createElasticError
(String context, @Nullable Long agentId, @Nullable ThrowableDetails throwableDetails, @Nullable String instanceId) Create an error regarding Elastic Bamboo.void
createError
(@Nullable String entityKey, Integer resultNumber, Long agentId, String context, ThrowableDetails throwableDetails) void
createError
(@Nullable String entityKey, Long resultNumber, Long agentId, String context, ThrowableDetails throwableDetails) @NotNull Collection<ErrorDetails>
Get all the errors recorded against all builds@NotNull Collection<ErrorDetails>
Get all the errors recorded against elastic bamboogetErrorDetails
(String buildKey, int errorNumber) Obtain the specified error from the handler.@NotNull Collection<ErrorDetails>
Obtain all the errors recorded against a specific plan@NotNull Collection<ErrorDetails>
Obtain all the errors recorded against a specific result@NotNull Collection<ErrorDetails>
getErrorsByAgentId
(Long agentId) Obtain all the errors recorded filtered by Agent Idvoid
removeBuildErrors
(String buildKey) Remove all the errors for a given buildvoid
removeError
(String buildKey, int errorNumber) Remove a specific error from the handler.Methods inherited from class com.atlassian.bamboo.logger.AbstractErrorUpdateHandler
addErrorCollection, getCurrentAgentId, recordElasticError, recordError, recordError, recordError, recordError, recordError, recordError, recordError
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.atlassian.bamboo.logger.ErrorUpdateHandler
addErrorCollection, recordElasticError, recordError, recordError, recordError, recordError, recordError, recordError, recordError
-
Constructor Details
-
DefaultErrorHandler
public DefaultErrorHandler(AgentContext agentContext, com.atlassian.event.api.EventPublisher eventPublisher)
-
-
Method Details
-
createElasticError
public void createElasticError(String context, @Nullable @Nullable Long agentId, @Nullable @Nullable ThrowableDetails throwableDetails, @Nullable @Nullable String instanceId) Description copied from interface:ErrorUpdateHandler
Create an error regarding Elastic Bamboo.- Specified by:
createElasticError
in interfaceErrorUpdateHandler
-
createError
public void createError(@Nullable @Nullable String entityKey, Integer resultNumber, Long agentId, String context, ThrowableDetails throwableDetails) - Specified by:
createError
in interfaceErrorUpdateHandler
-
createError
public void createError(@Nullable @Nullable String entityKey, Long resultNumber, Long agentId, String context, ThrowableDetails throwableDetails) - Specified by:
createError
in interfaceErrorUpdateHandler
-
getErrors
Description copied from interface:ErrorAccessor
Obtain all the errors recorded against a specific result- Specified by:
getErrors
in interfaceErrorAccessor
- Returns:
- The collection
ErrorDetails
-
getErrors
Description copied from interface:ErrorAccessor
Obtain all the errors recorded against a specific plan- Specified by:
getErrors
in interfaceErrorAccessor
- Returns:
- The collection
ErrorDetails
-
getAllErrors
Description copied from interface:ErrorAccessor
Get all the errors recorded against all builds- Specified by:
getAllErrors
in interfaceErrorAccessor
- Returns:
- The collection
ErrorDetails
-
getErrorsByAgentId
Description copied from interface:ErrorAccessor
Obtain all the errors recorded filtered by Agent Id- Specified by:
getErrorsByAgentId
in interfaceErrorAccessor
- Returns:
- The collection
ErrorDetails
-
getElasticErrors
Description copied from interface:ErrorAccessor
Get all the errors recorded against elastic bamboo- Specified by:
getElasticErrors
in interfaceErrorAccessor
- Returns:
- The collection
ErrorDetails
-
clear
public void clear()Description copied from interface:ErrorHandler
Remove all errors from the handler- Specified by:
clear
in interfaceErrorHandler
-
removeError
Description copied from interface:ErrorHandler
Remove a specific error from the handler.- Specified by:
removeError
in interfaceErrorHandler
- Parameters:
buildKey
- The build containing the errorerrorNumber
- The errorIndex'th error to be associated with the build
-
getErrorDetails
Description copied from interface:ErrorHandler
Obtain the specified error from the handler.- Specified by:
getErrorDetails
in interfaceErrorHandler
- Parameters:
buildKey
- The build containing the error.errorNumber
- The errorIndex'th error to be associated with the build- Returns:
- The error details
-
removeBuildErrors
Description copied from interface:ErrorHandler
Remove all the errors for a given build- Specified by:
removeBuildErrors
in interfaceErrorHandler
- Parameters:
buildKey
- The key of the build
-