Skip to content

Commit

Permalink
[server.twisted.msgpack] ignore null transport
Browse files Browse the repository at this point in the history
  • Loading branch information
plq committed Jan 31, 2022
1 parent 3392994 commit 1a208e9
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions spyne/server/twisted/msgpack.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,16 +383,17 @@ def handle_error(self, p_ctx, others, exc):
p_ctx.oob_ctx.d.callback(out_object)
return

out_string = msgpack.packb(out_object)
p_ctx.transport.resp_length = len(out_string)
self.enqueue_outresp_data(id(p_ctx), out_string)
if p_ctx.transport is not None:
out_string = msgpack.packb(out_object)
p_ctx.transport.resp_length = len(out_string)
self.enqueue_outresp_data(id(p_ctx), out_string)

try:
process_contexts(self, others, p_ctx, error=error)

except Exception as e:
# Report but ignore any exceptions from auxiliary methods.
logger.error("Exception ignored from auxiliary method: %r", e)
logger.error("Exception ignored from aux method: %r", e)
logger.exception(e)

def _register_callbacks(self, d, p_ctx, others):
Expand Down

0 comments on commit 1a208e9

Please sign in to comment.