aws-panorama-package/src/main/java/software/amazon/panorama/package_/PanoramaExceptionTranslator.java [19:39]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public static BaseHandlerException translateForAPIException(final PanoramaException e,
                                                                final String operation,
                                                                final String resourceTypeName,
                                                                final String resourceIdentifier,
                                                                final String requestBody
    ) {
        if (e instanceof ValidationException) {
            return new CfnInvalidRequestException(requestBody, e);
        } else if (e instanceof ConflictException) {
            return new CfnResourceConflictException(resourceTypeName, resourceIdentifier,
                    String.format("%s already existed", resourceIdentifier), e);
        } else if (e instanceof AccessDeniedException) {
            return new CfnAccessDeniedException(e);
        } else if (e instanceof InternalServerException) {
            return new CfnInternalFailureException(e);
        } else if (e instanceof ResourceNotFoundException) {
            return new CfnNotFoundException(resourceTypeName, resourceIdentifier, e);
        }

        return new CfnGeneralServiceException(operation, e);
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



aws-panorama-packageversion/src/main/java/software/amazon/panorama/packageversion/PanoramaExceptionTranslator.java [19:39]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public static BaseHandlerException translateForAPIException(final PanoramaException e,
                                                                final String operation,
                                                                final String resourceTypeName,
                                                                final String resourceIdentifier,
                                                                final String requestBody
    ) {
        if (e instanceof ValidationException) {
            return new CfnInvalidRequestException(requestBody, e);
        } else if (e instanceof ConflictException) {
            return new CfnResourceConflictException(resourceTypeName, resourceIdentifier,
                    String.format("%s already existed", resourceIdentifier), e);
        } else if (e instanceof AccessDeniedException) {
            return new CfnAccessDeniedException(e);
        } else if (e instanceof InternalServerException) {
            return new CfnInternalFailureException(e);
        } else if (e instanceof ResourceNotFoundException) {
            return new CfnNotFoundException(resourceTypeName, resourceIdentifier, e);
        }

        return new CfnGeneralServiceException(operation, e);
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



