Search in sources :

Example 1 with InvalidPropertyException

use of com.synopsys.integration.configuration.config.InvalidPropertyException in project synopsys-detect by blackducksoftware.

the class ExceptionUtility method logException.

public void logException(Exception e) {
    if (e instanceof OperationException) {
        OperationException operationException = (OperationException) e;
        logException(operationException.getException());
    } else if (e instanceof DetectUserFriendlyException) {
        if (e.getCause() != null) {
            logger.debug(e.getCause().getMessage(), e.getCause());
        }
        logger.error(e.getMessage());
    } else if (e instanceof BlackDuckTimeoutExceededException) {
        logger.error(BLACKDUCK_TIMEOUT_ERROR_MESSAGE);
        logger.error(e.getMessage());
    } else if (e instanceof BlackDuckApiException) {
        BlackDuckApiException be = (BlackDuckApiException) e;
        logger.error(BLACKDUCK_ERROR_MESSAGE);
        logger.error(be.getMessage());
        logger.debug(be.getBlackDuckErrorCode());
        logger.error(be.getOriginalIntegrationRestException().getMessage());
    } else if (e instanceof IntegrationRestException) {
        logger.error(BLACKDUCK_ERROR_MESSAGE);
        logger.debug(e.getMessage(), e);
    } else if (e instanceof IntegrationException) {
        logger.error(BLACKDUCK_ERROR_MESSAGE);
        logger.debug(e.getMessage(), e);
    } else if (e instanceof InvalidPropertyException) {
        logger.error("A configuration error occured");
        logger.debug(e.getMessage(), e);
    } else {
        logUnrecognizedException(e);
    }
}
Also used : IntegrationRestException(com.synopsys.integration.rest.exception.IntegrationRestException) DetectUserFriendlyException(com.synopsys.integration.detect.configuration.DetectUserFriendlyException) IntegrationException(com.synopsys.integration.exception.IntegrationException) BlackDuckApiException(com.synopsys.integration.blackduck.exception.BlackDuckApiException) BlackDuckTimeoutExceededException(com.synopsys.integration.blackduck.exception.BlackDuckTimeoutExceededException) InvalidPropertyException(com.synopsys.integration.configuration.config.InvalidPropertyException) OperationException(com.synopsys.integration.detect.lifecycle.OperationException)

Aggregations

BlackDuckApiException (com.synopsys.integration.blackduck.exception.BlackDuckApiException)1 BlackDuckTimeoutExceededException (com.synopsys.integration.blackduck.exception.BlackDuckTimeoutExceededException)1 InvalidPropertyException (com.synopsys.integration.configuration.config.InvalidPropertyException)1 DetectUserFriendlyException (com.synopsys.integration.detect.configuration.DetectUserFriendlyException)1 OperationException (com.synopsys.integration.detect.lifecycle.OperationException)1 IntegrationException (com.synopsys.integration.exception.IntegrationException)1 IntegrationRestException (com.synopsys.integration.rest.exception.IntegrationRestException)1