(key=None, error_codes_pass=())
Map Google Cloud specific exceptions to the simplekv-API.

    This function exists so the gcstore module can be imported
    without needing to install google-cloud-storage (as we lazily
    import the google library)
Map Google Cloud specific exceptions to the simplekv-API.
Map Google Cloud specific exceptions to the simplekv - API .
def map_gcloud_exceptions(key=None, error_codes_pass=()):
    """Map Google Cloud specific exceptions to the simplekv-API.

    This function exists so the gcstore module can be imported
    without needing to install google-cloud-storage (as we lazily
    import the google library)
    """
    from google.cloud.exceptions import NotFound, GoogleCloudError
    from google.api_core.exceptions import ClientError

    try:
        yield
    except NotFound:
        if "NotFound" in error_codes_pass:
            pass
        else:
            raise KeyError(key)
    except GoogleCloudError:
        if "GoogleCloudError" in error_codes_pass:
            pass
        else:
            raise IOError
def map_gcloud_exceptions ( key = None , error_codes_pass = ( ) ) : from google . cloud . exceptions import NotFound , GoogleCloudError from google . api_core . exceptions import ClientError try : yield except NotFound : if "NotFound" in error_codes_pass : pass else : raise KeyError ( key ) except GoogleCloudError : if "GoogleCloudError" in error_codes_pass : pass else : raise IOError