def _should_ignore_gql_exception()

in lca-ai-stack/source/lambda_functions/call_event_stream_processor/call_event_handler.py [0:0]


    def _should_ignore_gql_exception(exception: Exception) -> bool:
        if isinstance(exception, TransportQueryError) and hasattr(exception, "errors"):
            errors = exception.errors or []
            for error in errors:
                # two call channels have the same transaction/call id which causes
                # an expected exception
                if (
                    "createCall" in error.get("path", [])
                    and "item already exists" in error.get("message", "").lower()
                ):
                    return True

        return False