(compiled_map, # type: Dict[str, CouchbaseException]
err_content # type: str
)
| 1974 | class 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 |
no test coverage detected