@SuppressWarnings("unchecked")
    private ApiGatewayErrorUnmarshaller createErrorUnmarshaller(JsonErrorShapeMetadata errorShape) {
        return new ApiGatewayErrorUnmarshaller(
                (Class<? extends BaseException>) errorShape.getModeledClass(),
                Optional.of(errorShape.getHttpStatusCode()));
    }
Creates a response handler for handling a error response (non 2xx response).
aws-java-sdk-opensdk/src/main/java/com/amazonaws/opensdk/protect/protocol/ApiGatewayProtocolFactoryImpl.java