##// END OF EJS Templates
wireprotov1peer: don't raise internal errors in some cases...
Valentin Gatien-Baron -
r47430:aa2e3814 default
parent child Browse files
Show More
@@ -201,7 +201,9 b' def callcatch(ui, func):'
201 201 msg = inst.args[1]
202 202 if isinstance(msg, type(u'')):
203 203 msg = pycompat.sysbytes(msg)
204 if not isinstance(msg, bytes):
204 if msg is None:
205 ui.error(b"\n")
206 elif not isinstance(msg, bytes):
205 207 ui.error(b" %r\n" % (msg,))
206 208 elif not msg:
207 209 ui.error(_(b" empty string\n"))
@@ -310,7 +310,7 b' class peerexecutor(object):'
310 310 if not f.done():
311 311 f.set_exception(
312 312 error.ResponseError(
313 _(b'unfulfilled batch command response')
313 _(b'unfulfilled batch command response'), None
314 314 )
315 315 )
316 316
@@ -322,16 +322,27 b' class peerexecutor(object):'
322 322 for command, f, batchable, fremote in states:
323 323 # Grab raw result off the wire and teach the internal future
324 324 # about it.
325 remoteresult = next(wireresults)
326 fremote.set(remoteresult)
325 try:
326 remoteresult = next(wireresults)
327 except StopIteration:
328 # This can happen in particular because next(batchable)
329 # in the previous iteration can call peer._abort, which
330 # may close the peer.
331 f.set_exception(
332 error.ResponseError(
333 _(b'unfulfilled batch command response'), None
334 )
335 )
336 else:
337 fremote.set(remoteresult)
327 338
328 # And ask the coroutine to decode that value.
329 try:
330 result = next(batchable)
331 except Exception:
332 pycompat.future_set_exception_info(f, sys.exc_info()[1:])
333 else:
334 f.set_result(result)
339 # And ask the coroutine to decode that value.
340 try:
341 result = next(batchable)
342 except Exception:
343 pycompat.future_set_exception_info(f, sys.exc_info()[1:])
344 else:
345 f.set_result(result)
335 346
336 347
337 348 @interfaceutil.implementer(
@@ -9,5 +9,7 b' Checking that when lookup multiple bookm'
9 9 fails (thus causing the sshpeer to be stopped), the errors from the
10 10 further lookups don't result in tracebacks.
11 11
12 $ hg pull -r b0 -r nosuchbookmark $(for i in $($TESTDIR/seq.py 1 20); do echo -r b$i; done) -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/$(pwd)/../a |& tail -n 1
13 StopIteration
12 $ hg pull -r b0 -r nosuchbookmark $(for i in $($TESTDIR/seq.py 1 20); do echo -r b$i; done) -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/$(pwd)/../a
13 pulling from ssh://user@dummy/$TESTTMP/b/../a
14 abort: unknown revision 'nosuchbookmark'
15 [255]
General Comments 0
You need to be logged in to leave comments. Login now