lfs: use ProgrammingError for invalid action in _batch

Summary:
_batch is called by programmers. If action is not expected, it's a
ProgrammingError.

Test Plan: arc unit

Reviewers: #mercurial, rmcelroy

Reviewed By: rmcelroy

Subscribers: mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D5056822

Signature: t1:5056822:1494634121:59737eb0d3f42d706ee8b0dc18ec7a4b49ada34f
This commit is contained in:
Jun Wu 2017-05-12 17:14:52 -07:00
parent 07292913da
commit 34ffa6d4ce

View File

@ -58,8 +58,7 @@ class _gitlfsremote(object):
def _batch(self, pointers, localstore, action, total=None):
if action not in ['upload', 'download']:
# FIXME: we should not have that error raise too high
raise UnavailableBatchOperationError(None, action)
raise error.ProgrammingError('invalid Git-LFS action: %s' % action)
# Create the batch data for git-lfs.
urlreq = util.urlreq