Show More
@@ -263,23 +263,34 b' class _gitlfsremote(object):' | |||||
263 | # server implementation (ex. lfs-test-server) does not set "error" |
|
263 | # server implementation (ex. lfs-test-server) does not set "error" | |
264 | # but just removes "download" from "actions". Treat that case |
|
264 | # but just removes "download" from "actions". Treat that case | |
265 | # as the same as 404 error. |
|
265 | # as the same as 404 error. | |
266 | notfound = (response.get('error', {}).get('code') == 404 |
|
266 | if 'error' not in response: | |
267 |
|
|
267 | if (action == 'download' | |
268 |
|
|
268 | and action not in response.get('actions', [])): | |
269 | if notfound: |
|
269 | code = 404 | |
|
270 | else: | |||
|
271 | continue | |||
|
272 | else: | |||
|
273 | # An error dict without a code doesn't make much sense, so | |||
|
274 | # treat as a server error. | |||
|
275 | code = response.get('error').get('code', 500) | |||
|
276 | ||||
270 |
|
|
277 | ptrmap = {p.oid(): p for p in pointers} | |
271 |
|
|
278 | p = ptrmap.get(response['oid'], None) | |
272 |
|
|
279 | if p: | |
273 |
|
|
280 | filename = getattr(p, 'filename', 'unknown') | |
274 |
|
|
281 | errors = { | |
275 | _(('LFS server error. Remote object ' |
|
282 | 404: 'The object does not exist', | |
276 | 'for "%s" not found: %r')) % (filename, response)) |
|
283 | 410: 'The object was removed by the owner', | |
|
284 | 422: 'Validation error', | |||
|
285 | 500: 'Internal server error', | |||
|
286 | } | |||
|
287 | msg = errors.get(code, 'status code %d' % code) | |||
|
288 | raise LfsRemoteError(_('LFS server error for "%s": %s') | |||
|
289 | % (filename, msg)) | |||
277 |
|
|
290 | else: | |
278 |
|
|
291 | raise LfsRemoteError( | |
279 |
|
|
292 | _('LFS server error. Unsolicited response for oid %s') | |
280 |
|
|
293 | % response['oid']) | |
281 | if 'error' in response: |
|
|||
282 | raise LfsRemoteError(_('LFS server error: %r') % response) |
|
|||
283 |
|
294 | |||
284 | def _extractobjects(self, response, pointers, action): |
|
295 | def _extractobjects(self, response, pointers, action): | |
285 | """extract objects from response of the batch API |
|
296 | """extract objects from response of the batch API |
@@ -449,7 +449,7 b' TODO: give the proper error indication f' | |||||
449 | Content-Type: text/plain; charset=utf-8 (git-server !) |
|
449 | Content-Type: text/plain; charset=utf-8 (git-server !) | |
450 | Date: $HTTP_DATE$ (git-server !) |
|
450 | Date: $HTTP_DATE$ (git-server !) | |
451 | abort: corrupt remote lfs object: d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 (git-server !) |
|
451 | abort: corrupt remote lfs object: d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 (git-server !) | |
452 |
abort: LFS server error |
|
452 | abort: LFS server error for "c": Validation error! (hg-server !) | |
453 | [255] |
|
453 | [255] | |
454 |
|
454 | |||
455 | The corrupted blob is not added to the usercache or local store |
|
455 | The corrupted blob is not added to the usercache or local store | |
@@ -807,7 +807,7 b' Check error message when the remote miss' | |||||
807 | ] |
|
807 | ] | |
808 | "transfer": "basic" (hg-server !) |
|
808 | "transfer": "basic" (hg-server !) | |
809 | } |
|
809 | } | |
810 |
abort: LFS server error |
|
810 | abort: LFS server error for "b": The object does not exist! | |
811 | [255] |
|
811 | [255] | |
812 |
|
812 | |||
813 | Check error message when object does not exist: |
|
813 | Check error message when object does not exist: | |
@@ -918,7 +918,7 b' Check error message when object does not' | |||||
918 | ] |
|
918 | ] | |
919 | "transfer": "basic" (hg-server !) |
|
919 | "transfer": "basic" (hg-server !) | |
920 | } |
|
920 | } | |
921 |
abort: LFS server error |
|
921 | abort: LFS server error for "a": The object does not exist! | |
922 | [255] |
|
922 | [255] | |
923 |
|
923 | |||
924 |
$ $ |
|
924 | $ $PYTHON $RUNTESTDIR/killdaemons.py $DAEMON_PIDS |
General Comments 0
You need to be logged in to leave comments.
Login now