def _giveup_client_error(exc: Exception) ->bool:
    """Handler for the backoff decorator to stop retrying boto3 client errors.

    Args:
        exc: Exception raised by a function decorated with ``backoff.on_exception``

    Returns:
        True if the status code is a client error (HTTP 4xx), False otherwise

    """
    try:
        return 400 <= exc.response['ResponseMetadata']['HTTPStatusCode'] < 500
    except (AttributeError, KeyError):
        return False
