## Is your feature request related to a problem?

When sending incorrectly formatted payloads (e.g. a text-based string with a `gzip` compression header), the app will fail with a cryptic 500 error and register an unhandled exception.

## Describe the solution you'd like
The app should return a 400 bad request error, with details on why the request failed (i.e. it is incorrectly formatted or the content does not match the compression specified). In addition, this shouldn't be treated as an unhandled exception as it's a client error.


## Describe alternatives you've considered
Keep returning a cryptic 500 error.


## Additional context
Relevant context on #2701


#### *Thank you* for your feature request – we love each and every one!

posthog/utils.py
start_date: Optional[datetime.datetime], end_date: Optional[datetime.datetime], frequency: str
) -> List[Any]:
    """
    Returns list of a fixed frequency Datetime objects between given bounds.
    Parameters:
        start_date: Left bound for generating dates.
        end_date: Right bound for generating dates.
        frequency: Possible options => minute, hour, day, week, month
    """
    delta = DATERANGE_MAP[frequency]
    if not start_date or not end_date:
        return []
    time_range = []
    if frequency != "minute" and frequency != "hour":
        start_date = start_date.replace(hour=0, minute=0, second=0, microsecond=0)
        end_date = end_date.replace(hour=0, minute=0, second=0, microsecond=0)
    if frequency == "week":
        start_date -= datetime.timedelta(days=start_date.weekday() + 1)
    if frequency != "month":
        while start_date <= end_date:
            time_range.append(start_date)
            start_date += delta
    else:
        if start_date.day != 1:
            start_date = (start_date.replace(day=1)).replace(day=1)
        while start_date <= end_date:
            time_range.append(start_date)
            start_date = (start_date.replace(day=1) + delta).replace(day=1)
    return time_range
def get_safe_cache(cache_key: str):