#2724 closed bug (Fixed)
JSON-RPC not forwarding exceptions/errors causing browser to time-out on calls
Reported by: | amain | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 2.0.0 |
Component: | Web UI | Version: | 1.3.11 |
Keywords: | exception, error, rpc, json | Cc: |
Description
ui/web/json_api.py:
def _on_rpc_request_failed(self, reason, response, request): """ Handles any failures that occurred while making an rpc call. """ request.setResponseCode(http.INTERNAL_SERVER_ERROR)
Above code will never send back a JSON-RPC response to the browser. Causing the browser to time-out. This can easily be reproduced by raising an DelugeError exception in one of the Deluge daemon @export RPC methods.
As a result exceptions can't be used to inform browser on RPC failures. Note that there is also no other mechanism in Deluge to create JSON-RPC error responses. Making it hard to handle errors generically in the browser.
Note:
See TracTickets
for help on using tickets.
What would you suggest as a solution?