from twisted.internet import reactor
import time
+import sys
+from traceback import format_exception
+
import khash as hash
KRPC_TIMEOUT = 60
ret = apply(f, (), msg[ARG])
except Exception, e:
## send error
- out = bencode({TID:msg[TID], TYP:ERR, ERR :`e`})
+ out = bencode({TID:msg[TID], TYP:ERR, ERR :`format_exception(type(e), e, sys.exc_info()[2])`})
olen = len(out)
self.transport.write(out, addr)
else:
del(self.tids[msg[TID]])
df.callback({'rsp' : msg[RSP], '_krpc_sender': addr})
else:
- print 'timeout ' + `msg[RSP]['sender']`
+ print 'timeout ' + `msg[RSP]['id']`
# no tid, this transaction timed out already...
elif msg[TYP] == ERR:
# if error