aws-panorama-applicationinstance/src/main/java/software/amazon/panorama/applicationinstance/PanoramaExceptionTranslator.java [19:37]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
public class PanoramaExceptionTranslator {

    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);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



aws-panorama-packageversion/src/main/java/software/amazon/panorama/packageversion/PanoramaExceptionTranslator.java [17:35]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
public class PanoramaExceptionTranslator {

    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);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



