MCPcopy
hub / github.com/redis/redis-py / parse_error

Method parse_error

redis/_parsers/base.py:104–113  ·  view source on GitHub ↗

Parse an error response

(cls, response)

Source from the content-addressed store, hash-verified

102
103 @classmethod
104 def parse_error(cls, response):
105 "Parse an error response"
106 error_code = response.split(" ")[0]
107 if error_code in cls.EXCEPTION_CLASSES:
108 response = response[len(error_code) + 1 :]
109 exception_class = cls.EXCEPTION_CLASSES[error_code]
110 if isinstance(exception_class, dict):
111 exception_class = exception_class.get(response, ResponseError)
112 return exception_class(response, status_code=error_code)
113 return ResponseError(response)
114
115 @abstractmethod
116 def on_disconnect(self):

Callers 4

_read_responseMethod · 0.80
_read_responseMethod · 0.80
_read_responseMethod · 0.80
_read_responseMethod · 0.80

Calls 2

ResponseErrorClass · 0.85
getMethod · 0.45

Tested by

no test coverage detected