MCPcopy Index your code
hub / github.com/couchbase/couchbase-python-client / _process_mapping

Method _process_mapping

couchbase/exceptions.py:1976–1988  ·  view source on GitHub ↗
(compiled_map,  # type: Dict[str, CouchbaseException]
                         err_content  # type: str
                         )

Source from the content-addressed store, hash-verified

1974class ErrorMapper:
1975 @staticmethod
1976 def _process_mapping(compiled_map, # type: Dict[str, CouchbaseException]
1977 err_content # type: str
1978 ) -> Optional[CouchbaseException]:
1979 matches = None
1980 for pattern, exc_class in compiled_map.items():
1981 try:
1982 matches = pattern.match(err_content)
1983 except Exception: # nosec
1984 pass
1985 if matches:
1986 return exc_class
1987
1988 return None
1989
1990 @staticmethod # noqa: C901
1991 def _parse_http_response_body(compiled_map, # type: Dict[str, CouchbaseException] # noqa: C901

Callers 3

_parse_http_contextMethod · 0.80
_parse_kv_contextMethod · 0.80

Calls 2

matchMethod · 0.80
itemsMethod · 0.45

Tested by

no test coverage detected