MCPcopy Index your code
hub / github.com/raiden-network/raiden / api_error

Function api_error

raiden/api/rest_utils.py:38–48  ·  view source on GitHub ↗
(errors: Any, status_code: HTTPStatus)

Source from the content-addressed store, hash-verified

36
37
38def api_error(errors: Any, status_code: HTTPStatus) -> Response:
39 assert status_code in ERROR_STATUS_CODES, "Programming error, unexpected error status code"
40 log.error("Error processing request", errors=errors, status_code=status_code)
41 response = make_response(
42 (
43 json.dumps(dict(errors=errors)),
44 status_code,
45 {"mimetype": "application/json", "Content-Type": "application/json"},
46 )
47 )
48 return response
49
50
51def if_api_available(method: Callable) -> Callable:

Callers 15

endpoint_not_foundFunction · 0.90
_serve_webuiMethod · 0.90
unhandled_exceptionMethod · 0.90
register_tokenMethod · 0.90
mint_token_forMethod · 0.90
openMethod · 0.90
get_channelMethod · 0.90
get_partners_by_tokenMethod · 0.90
initiate_paymentMethod · 0.90

Calls 1

make_responseFunction · 0.85

Tested by

no test coverage detected