Browse Source

daemon: fix local RPC server error messages to conform to jsonrpc spec

fixes #6672
patch-4
SomberNight 4 years ago
parent
commit
ec0f91942d
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 5
      electrum/daemon.py

5
electrum/daemon.py

@ -207,7 +207,10 @@ class AuthenticatedServer(Logger):
response['result'] = await f(*params) response['result'] = await f(*params)
except BaseException as e: except BaseException as e:
self.logger.exception("internal error while executing RPC") self.logger.exception("internal error while executing RPC")
response['error'] = str(e) response['error'] = {
'code': 1,
'message': str(e),
}
return web.json_response(response) return web.json_response(response)

Loading…
Cancel
Save