MCPcopy Index your code
hub / github.com/Bitmessage/PyBitmessage / _dispatch

Method _dispatch

src/api.py:1051–1068  ·  view source on GitHub ↗
(self, method, params)

Source from the content-addressed store, hash-verified

1049 raise APIError(20, 'Invalid method: %s' % method)
1050
1051 def _dispatch(self, method, params):
1052 self.cookies = []
1053
1054 validuser = self.APIAuthenticateClient()
1055 if not validuser:
1056 time.sleep(2)
1057 return "RPC Username or password incorrect or HTTP header lacks authentication at all."
1058
1059 try:
1060 return self._handle_request(method, params)
1061 except APIError as e:
1062 return str(e)
1063 except varintDecodeError as e:
1064 logger.error(e)
1065 return "API Error 0026: Data contains a malformed varint. Some details: %s" % e
1066 except Exception as e:
1067 logger.exception(e)
1068 return "API Error 0021: Unexpected API Failure - %s" % str(e)
1069
1070

Callers

nothing calls this directly

Calls 2

APIAuthenticateClientMethod · 0.95
_handle_requestMethod · 0.95

Tested by

no test coverage detected