public static BaseHandlerException translateToCfnException()

in aws-nimblestudio-streamingimage/src/main/java/software/amazon/nimblestudio/streamingimage/ExceptionTranslator.java [22:40]


    public static BaseHandlerException translateToCfnException(final AwsServiceException exception) {
        if (exception instanceof AccessDeniedException) {
            return new CfnAccessDeniedException(ResourceModel.TYPE_NAME, exception);
        } else if (exception instanceof ValidationException) {
            return new CfnInvalidRequestException(exception);
        } else if (exception instanceof InternalServerErrorException) {
            return new CfnServiceInternalErrorException(exception);
        } else if (exception instanceof ServiceQuotaExceededException) {
            return new CfnServiceLimitExceededException(ResourceModel.TYPE_NAME, exception.getMessage(), exception);
        } else if (exception instanceof ResourceNotFoundException) {
            return new CfnNotFoundException(exception);
        } else if (exception instanceof ThrottlingException) {
            return new CfnThrottlingException(exception);
        } else if (exception instanceof ConflictException) {
            return new CfnResourceConflictException(exception);
        } else {
            return new CfnGeneralServiceException(exception.getMessage(), exception);
        }
    }