changeset 40703:93e5d18251d6

lfs: make the exception messages consistent I don't love that it repeats 'HTTP Error' in an already long message, but I doubt that we should assume that it will always say that on the original exception message.
author Matt Harbison <matt_harbison@yahoo.com>
date Thu, 15 Nov 2018 18:14:57 -0500
parents 380f5131ee7b
children c53f0ead5781
files hgext/lfs/blobstore.py tests/test-lfs-serve-access.t
diffstat 2 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/lfs/blobstore.py	Thu Nov 15 18:08:29 2018 -0500
+++ b/hgext/lfs/blobstore.py	Thu Nov 15 18:14:57 2018 -0500
@@ -441,7 +441,7 @@
         except util.urlerr.httperror as ex:
             if self.ui.debugflag:
                 self.ui.debug('%s: %s\n' % (oid, ex.read()))
-            raise LfsRemoteError(_('HTTP error: %s (oid=%s, action=%s)')
+            raise LfsRemoteError(_('LFS HTTP error: %s (oid=%s, action=%s)')
                                  % (ex, oid, action))
         except util.urlerr.urlerror as ex:
             hint = (_('attempted connection to %s')
--- a/tests/test-lfs-serve-access.t	Thu Nov 15 18:08:29 2018 -0500
+++ b/tests/test-lfs-serve-access.t	Thu Nov 15 18:14:57 2018 -0500
@@ -282,7 +282,7 @@
   $ hg -R client push http://localhost:$HGPORT1
   pushing to http://localhost:$HGPORT1/
   searching for changes
-  abort: HTTP error: HTTP Error 422: corrupt blob (oid=b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c, action=upload)!
+  abort: LFS HTTP error: HTTP Error 422: corrupt blob (oid=b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c, action=upload)!
   [255]
 
   $ echo 'test lfs file' > server/lfs3.bin
@@ -294,14 +294,14 @@
 
   $ hg --config lfs.url=http://localhost:$HGPORT1/.git/info/lfs \
   >    -R client update -r tip
-  abort: HTTP error: HTTP Error 500: Internal Server Error (oid=276f73cfd75f9fb519810df5f5d96d6594ca2521abd86cbcd92122f7d51a1f3d, action=download)!
+  abort: LFS HTTP error: HTTP Error 500: Internal Server Error (oid=276f73cfd75f9fb519810df5f5d96d6594ca2521abd86cbcd92122f7d51a1f3d, action=download)!
   [255]
 
 Test a checksum failure during the processing of the GET request
 
   $ hg --config lfs.url=http://localhost:$HGPORT1/.git/info/lfs \
   >    -R client update -r tip
-  abort: HTTP error: HTTP Error 422: corrupt blob (oid=276f73cfd75f9fb519810df5f5d96d6594ca2521abd86cbcd92122f7d51a1f3d, action=download)!
+  abort: LFS HTTP error: HTTP Error 422: corrupt blob (oid=276f73cfd75f9fb519810df5f5d96d6594ca2521abd86cbcd92122f7d51a1f3d, action=download)!
   [255]
 
   $ "$PYTHON" $RUNTESTDIR/killdaemons.py $DAEMON_PIDS