firebase_admin/_utils.py
def handle_platform_error_from_googleapiclient(error, handle_func=None):
    """Constructs a ``FirebaseError`` from the given googleapiclient error.

    This can be used to handle errors returned by Google Cloud Platform (GCP) APIs.

    Args:
        error: An error raised by the googleapiclient while making an HTTP call to a GCP API.
        handle_func: A function that can be used to handle platform errors in a custom way. When
            specified, this function will be called with three arguments. It has the same
            signature as ```_handle_func_googleapiclient``, but may return ``None``.

    Returns:
        FirebaseError: A ``FirebaseError`` that can be raised to the user code.
    """
    if not isinstance(error, googleapiclient.errors.HttpError):
        return handle_googleapiclient_error(error)

    content = error.content.decode()
    status_code = error.resp.status
    error_dict, message = _parse_platform_error(content, status_code)
    http_response = _http_response_from_googleapiclient_error(error)
    exc = None
    if handle_func:
        exc = handle_func(error, message, error_dict, http_response)

    return exc if exc else _handle_func_googleapiclient(error, message, error_dict, http_response)
Constructs a ``FirebaseError`` from the given googleapiclient error.

    This can be used to handle errors returned by Google Cloud Platform (GCP) APIs.

    Args:
        error: An error raised by the googleapiclient while making an HTTP call to a GCP API.
        handle_func: A function that can be used to handle platform errors in a custom way. When
            specified, this function will be called with three arguments. It has the same
            signature as ```_handle_func_googleapiclient``, but may return ``None``.

    Returns:
        FirebaseError: A ``FirebaseError`` that can be raised to the user code.
    
Constructs a ``FirebaseError`` from the given googleapiclient error.
This can be used to handle errors returned by Google Cloud Platform (GCP) APIs.
Constructs a ` ` FirebaseError ` ` from the given googleapiclient error . This can be used to handle errors returned by Google Cloud Platform ( GCP ) APIs .
def handle_platform_error_from_googleapiclient(error, handle_func=None):
    if not isinstance(error, googleapiclient.errors.HttpError):
        return handle_googleapiclient_error(error)
    content = error.content.decode()
    status_code = error.resp.status
    error_dict, message = _parse_platform_error(content, status_code)
    http_response = _http_response_from_googleapiclient_error(error)
    exc = None
    if handle_func:
        exc = handle_func(error, message, error_dict, http_response)
    return exc if exc else _handle_func_googleapiclient(error, message, error_dict, http_response)
def handle_platform_error_from_googleapiclient ( error , handle_func = None ) : if not isinstance ( error , googleapiclient . errors . HttpError ) : return handle_googleapiclient_error ( error ) content = error . content . decode ( ) status_code = error . resp . status error_dict , message = _parse_platform_error ( content , status_code ) http_response = _http_response_from_googleapiclient_error ( error ) exc = None if handle_func : exc = handle_func ( error , message , error_dict , http_response ) return exc if exc else _handle_func_googleapiclient ( error , message , error_dict , http_response )
Constructs a ``FirebaseError`` from the given googleapiclient error.
Constructs a ` ` FirebaseError ` ` from the given googleapiclient error .
"""Constructs a ``FirebaseError`` from the given googleapiclient error.

    This can be used to handle errors returned by Google Cloud Platform (GCP) APIs.

    Args:
        error: An error raised by the googleapiclient while making an HTTP call to a GCP API.
        handle_func: A function that can be used to handle platform errors in a custom way. When
            specified, this function will be called with three arguments. It has the same
            signature as ```_handle_func_googleapiclient``, but may return ``None``.

    Returns:
        FirebaseError: A ``FirebaseError`` that can be raised to the user code.
    """
A ``FirebaseError`` that can be raised to the user code.
A ` ` FirebaseError ` ` that can be raised to the user code .
FirebaseError
error
An error raised by the googleapiclient while making an HTTP call to a GCP API.
An error raised by the googleapiclient while making an HTTP call to a GCP API .
handle_func
A function that can be used to handle platform errors in a custom way. When
specified, this function will be called with three arguments. It has the same
signature as ```_handle_func_googleapiclient``, but may return ``None``.
A function that can be used to handle platform errors in a custom way . When specified this function will be called with three arguments . It has the same signature as ` ` ` _handle_func_googleapiclient ` ` but may return ` ` None ` ` .