# Path: src/bananas/drf/errors.py
# class BadRequest(APIException):
#     status_code = status.HTTP_400_BAD_REQUEST
#     default_detail = "Validation failed"
#     default_code = "bad_request"


import datetime
from typing import FrozenSet, Iterable
from django.utils.http import parse_http_date
from rest_framework.request import Request
from .errors import BadRequest



__all__ = (
    "HeaderError",
    "MissingHeader",
    "InvalidHeader",
    "parse_header_datetime",
    "parse_header_etags",
)


class HeaderError(ValueError):
    code = "invalid_header"


# Path: src/bananas/drf/errors.py
# class BadRequest(APIException):
#     status_code = status.HTTP_400_BAD_REQUEST
#     default_detail = "Validation failed"
#     default_code = "bad_request"


# Path: src/bananas/drf/utils.py
import datetime
from typing import FrozenSet, Iterable
from django.utils.http import parse_http_date
from rest_framework.request import Request
from .errors import BadRequest




__all__ = (
    "HeaderError",
    "MissingHeader",
    "InvalidHeader",
    "parse_header_datetime",
    "parse_header_etags",
)


class HeaderError(ValueError):
    code = "invalid_header"


    def as_api_error(self) -> BadRequest: