##// END OF EJS Templates
lfs: provide more Batch API error info via a hint in the raised exception...
Matt Harbison -
r40695:8863f08c default
parent child Browse files
Show More
@@ -263,16 +263,17 b' class _gitlfsremote(object):'
263 263 'objects': objects,
264 264 'operation': action,
265 265 })
266 batchreq = util.urlreq.request('%s/objects/batch' % self.baseurl,
267 data=requestdata)
266 url = '%s/objects/batch' % self.baseurl
267 batchreq = util.urlreq.request(url, data=requestdata)
268 268 batchreq.add_header('Accept', 'application/vnd.git-lfs+json')
269 269 batchreq.add_header('Content-Type', 'application/vnd.git-lfs+json')
270 270 try:
271 271 rsp = self.urlopener.open(batchreq)
272 272 rawjson = rsp.read()
273 273 except util.urlerr.httperror as ex:
274 raise LfsRemoteError(_('LFS HTTP error: %s (action=%s)')
275 % (ex, action))
274 raise LfsRemoteError(_('LFS HTTP error: %s') % ex,
275 hint=_('api=%s, action=%s')
276 % (url, action))
276 277 try:
277 278 response = json.loads(rawjson)
278 279 except ValueError:
@@ -29,7 +29,8 b' Uploads fail...'
29 29 $ hg -R client push http://localhost:$HGPORT
30 30 pushing to http://localhost:$HGPORT/
31 31 searching for changes
32 abort: LFS HTTP error: HTTP Error 400: no such method: .git (action=upload)!
32 abort: LFS HTTP error: HTTP Error 400: no such method: .git!
33 (api=http://localhost:$HGPORT/.git/info/lfs/objects/batch, action=upload)
33 34 [255]
34 35
35 36 ... so do a local push to make the data available. Remove the blob from the
@@ -50,7 +51,8 b' Downloads fail...'
50 51 added 1 changesets with 1 changes to 1 files
51 52 new changesets 525251863cad
52 53 updating to branch default
53 abort: LFS HTTP error: HTTP Error 400: no such method: .git (action=download)!
54 abort: LFS HTTP error: HTTP Error 400: no such method: .git!
55 (api=http://localhost:$HGPORT/.git/info/lfs/objects/batch, action=download)
54 56 [255]
55 57
56 58 $ "$PYTHON" $RUNTESTDIR/killdaemons.py $DAEMON_PIDS
General Comments 0
You need to be logged in to leave comments. Login now