forked from M-Labs/artiq
comm_kernel: fix RPC exception handling (#1801)
This commit is contained in:
parent
b6c59a0cb3
commit
3f812c4c2c
|
@ -563,14 +563,6 @@ class CommKernel:
|
||||||
|
|
||||||
try:
|
try:
|
||||||
result = service(*args, **kwargs)
|
result = service(*args, **kwargs)
|
||||||
logger.debug("rpc service: %d %r %r = %r",
|
|
||||||
service_id, args, kwargs, result)
|
|
||||||
|
|
||||||
self._write_header(Request.RPCReply)
|
|
||||||
self._write_bytes(return_tags)
|
|
||||||
self._send_rpc_value(bytearray(return_tags),
|
|
||||||
result, result, service)
|
|
||||||
self._flush()
|
|
||||||
except RPCReturnValueError as exn:
|
except RPCReturnValueError as exn:
|
||||||
raise
|
raise
|
||||||
except Exception as exn:
|
except Exception as exn:
|
||||||
|
@ -617,6 +609,14 @@ class CommKernel:
|
||||||
self._write_int32(-1) # column not known
|
self._write_int32(-1) # column not known
|
||||||
self._write_string(function)
|
self._write_string(function)
|
||||||
self._flush()
|
self._flush()
|
||||||
|
else:
|
||||||
|
logger.debug("rpc service: %d %r %r = %r",
|
||||||
|
service_id, args, kwargs, result)
|
||||||
|
self._write_header(Request.RPCReply)
|
||||||
|
self._write_bytes(return_tags)
|
||||||
|
self._send_rpc_value(bytearray(return_tags),
|
||||||
|
result, result, service)
|
||||||
|
self._flush()
|
||||||
|
|
||||||
def _serve_exception(self, embedding_map, symbolizer, demangler):
|
def _serve_exception(self, embedding_map, symbolizer, demangler):
|
||||||
name = self._read_string()
|
name = self._read_string()
|
||||||
|
|
Loading…
Reference in New Issue