Mercurial > public > mercurial-scm > hg
comparison mercurial/wireprotov2server.py @ 37726:0c184ca594bb
wireprotov2: change behavior of error frame
Now that we have a leading CBOR map in command response frames
to indicate overall command result status, we don't need to use
the error response frame to represent command errors. Instead,
we can reserve it for protocol and server level errors. And for the
special case of a command error that occurred after command response
frames were emitted.
The code for error handling still needs a ton of work. But we're
slowly going in the right direction...
Differential Revision: https://phab.mercurial-scm.org/D3386
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sat, 14 Apr 2018 15:36:12 -0700 |
parents | 3ea8323d6f95 |
children | 5cdde6158426 |
comparison
equal
deleted
inserted
replaced
37725:3ea8323d6f95 | 37726:0c184ca594bb |
---|---|
309 encoded = cbor.dumps(rsp.value, canonical=True) | 309 encoded = cbor.dumps(rsp.value, canonical=True) |
310 action, meta = reactor.oncommandresponseready(outstream, | 310 action, meta = reactor.oncommandresponseready(outstream, |
311 command['requestid'], | 311 command['requestid'], |
312 encoded) | 312 encoded) |
313 else: | 313 else: |
314 action, meta = reactor.onapplicationerror( | 314 action, meta = reactor.onservererror( |
315 _('unhandled response type from wire proto command')) | 315 _('unhandled response type from wire proto command')) |
316 | 316 |
317 if action == 'sendframes': | 317 if action == 'sendframes': |
318 res.setbodygen(meta['framegen']) | 318 res.setbodygen(meta['framegen']) |
319 return True | 319 return True |