in deliverystream/src/main/java/com/amazonaws/kinesisfirehose/deliverystream/ExceptionMapper.java [22:41]
static HandlerErrorCode mapToHandlerErrorCode(final Exception exception, final HandlerType handlerType) {
if (exception instanceof ResourceInUseException) {
if(handlerType.toString().equals(HandlerType.CREATE.toString())) {
return HandlerErrorCode.AlreadyExists;
}
return HandlerErrorCode.ResourceConflict;
} else if (exception instanceof InvalidArgumentException) {
return HandlerErrorCode.InvalidRequest;
} else if (exception instanceof InvalidKmsResourceException) {
return HandlerErrorCode.InvalidRequest;
} else if (exception instanceof LimitExceededException) {
return HandlerErrorCode.ServiceLimitExceeded;
} else if (exception instanceof ResourceNotFoundException) {
return HandlerErrorCode.NotFound;
} else if (exception instanceof FirehoseException) {
return HandlerErrorCode.ServiceInternalError;
} else {
return HandlerErrorCode.InternalFailure;
}
}