# This file was auto-generated by Fern from our API Definition.

try:
    from websockets.exceptions import InvalidStatusCode as InvalidWebSocketStatus  # type: ignore[attr-defined]

    def get_status_code(exc: InvalidWebSocketStatus) -> int:
        return exc.status_code  # type: ignore[attr-defined, union-attr]

except ImportError:
    from websockets.exceptions import InvalidStatus as InvalidWebSocketStatus  # type: ignore[assignment, no-redef]

    def get_status_code(exc: InvalidWebSocketStatus) -> int:  # type: ignore[no-redef]
        return exc.response.status_code  # type: ignore[attr-defined, union-attr]
