comparison mercurial/scmutil.py @ 45877:ac362d5a7893

errors: introduce CanceledError and use it in a few places This very similar to earlier patches (e.g. for `InputError`) and part of https://www.mercurial-scm.org/wiki/ErrorCategoriesPlan. Differential Revision: https://phab.mercurial-scm.org/D9339
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 22 Oct 2020 14:14:59 -0700
parents 4b4160a83303
children 7a273336d3d3
comparison
equal deleted inserted replaced
45876:568c05d8f3d2 45877:ac362d5a7893
259 detailed_exit_code = 10 259 detailed_exit_code = 10
260 elif isinstance(inst, error.StateError): 260 elif isinstance(inst, error.StateError):
261 detailed_exit_code = 20 261 detailed_exit_code = 20
262 elif isinstance(inst, error.ConfigError): 262 elif isinstance(inst, error.ConfigError):
263 detailed_exit_code = 30 263 detailed_exit_code = 30
264 elif isinstance(inst, error.CanceledError):
265 detailed_exit_code = 250
264 ui.error(_(b"abort: %s\n") % inst.message) 266 ui.error(_(b"abort: %s\n") % inst.message)
265 if inst.hint: 267 if inst.hint:
266 ui.error(_(b"(%s)\n") % inst.hint) 268 ui.error(_(b"(%s)\n") % inst.hint)
267 except error.WorkerError as inst: 269 except error.WorkerError as inst:
268 # Don't print a message -- the worker already should have 270 # Don't print a message -- the worker already should have