comparison mercurial/scmutil.py @ 45839:ebee234d952a

errors: set detailed exit code to 100 for some remote errors This is per https://www.mercurial-scm.org/wiki/ErrorCategoriesPlan. Differential Revision: https://phab.mercurial-scm.org/D9309
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 22 Oct 2020 13:31:34 -0700
parents ae00e170f2d1
children 527ce85c2e60
comparison
equal deleted inserted replaced
45838:ae00e170f2d1 45839:ebee234d952a
180 inst.desc or stringutil.forcebytestr(inst.filename), 180 inst.desc or stringutil.forcebytestr(inst.filename),
181 encoding.strtolocal(inst.strerror), 181 encoding.strtolocal(inst.strerror),
182 ) 182 )
183 ) 183 )
184 except error.OutOfBandError as inst: 184 except error.OutOfBandError as inst:
185 detailed_exit_code = 100
185 if inst.args: 186 if inst.args:
186 msg = _(b"abort: remote error:\n") 187 msg = _(b"abort: remote error:\n")
187 else: 188 else:
188 msg = _(b"abort: remote error\n") 189 msg = _(b"abort: remote error\n")
189 ui.error(msg) 190 ui.error(msg)
235 if m in b"mpatch bdiff".split(): 236 if m in b"mpatch bdiff".split():
236 ui.error(_(b"(did you forget to compile extensions?)\n")) 237 ui.error(_(b"(did you forget to compile extensions?)\n"))
237 elif m in b"zlib".split(): 238 elif m in b"zlib".split():
238 ui.error(_(b"(is your Python install correct?)\n")) 239 ui.error(_(b"(is your Python install correct?)\n"))
239 except util.urlerr.httperror as inst: 240 except util.urlerr.httperror as inst:
241 detailed_exit_code = 100
240 ui.error(_(b"abort: %s\n") % stringutil.forcebytestr(inst)) 242 ui.error(_(b"abort: %s\n") % stringutil.forcebytestr(inst))
241 except util.urlerr.urlerror as inst: 243 except util.urlerr.urlerror as inst:
244 detailed_exit_code = 100
242 try: # usually it is in the form (errno, strerror) 245 try: # usually it is in the form (errno, strerror)
243 reason = inst.reason.args[1] 246 reason = inst.reason.args[1]
244 except (AttributeError, IndexError): 247 except (AttributeError, IndexError):
245 # it might be anything, for example a string 248 # it might be anything, for example a string
246 reason = inst.reason 249 reason = inst.reason