git-p4: raise exceptions from p4CmdList based on error from p4 server
commit55bb3e3611c7b3f7bbbaf8d9ce98a4ed4196c3eb
authorLuke Diamand <luke@diamand.org>
Fri, 8 Jun 2018 20:32:46 +0000 (8 21:32 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 12 Jun 2018 21:46:09 +0000 (12 14:46 -0700)
treea1f2183a0c9c1b7e3778055e5771ae391c58396d
parent0ef67acdd784852ee8e86dcdb653cc290c1a77a3
git-p4: raise exceptions from p4CmdList based on error from p4 server

This change lays some groundwork for better handling of rowcount errors
from the server, where it fails to send us results because we requested
too many.

It adds an option to p4CmdList() to return errors as a Python exception.

The exceptions are derived from P4Exception (something went wrong),
P4ServerException (the server sent us an error code) and
P4RequestSizeException (we requested too many rows/results from the
server database).

This makes the code that handles the errors a bit easier.

The default behavior is unchanged; the new code is enabled with a flag.

Signed-off-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-p4.py