Mercurial > hg
comparison mercurial/scmutil.py @ 45915:8f50dc096cf4
errors: introduce SecurityError and use it in a few places
This is part of
https://www.mercurial-scm.org/wiki/ErrorCategoriesPlan. There are
perhaps more errors in `sslutil.py` that should raise `SecurityError`;
I picked the most clear ones to start with.
Differential Revision: https://phab.mercurial-scm.org/D9390
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Mon, 23 Nov 2020 16:20:02 -0800 |
parents | 95c4cca641f6 |
children | aba4f2c97e74 |
comparison
equal
deleted
inserted
replaced
45914:be25b66f86ab | 45915:8f50dc096cf4 |
---|---|
226 detailed_exit_code = 10 | 226 detailed_exit_code = 10 |
227 elif isinstance(inst, error.StateError): | 227 elif isinstance(inst, error.StateError): |
228 detailed_exit_code = 20 | 228 detailed_exit_code = 20 |
229 elif isinstance(inst, error.ConfigError): | 229 elif isinstance(inst, error.ConfigError): |
230 detailed_exit_code = 30 | 230 detailed_exit_code = 30 |
231 elif isinstance(inst, error.SecurityError): | |
232 detailed_exit_code = 150 | |
231 elif isinstance(inst, error.CanceledError): | 233 elif isinstance(inst, error.CanceledError): |
232 detailed_exit_code = 250 | 234 detailed_exit_code = 250 |
233 ui.error(inst.format()) | 235 ui.error(inst.format()) |
234 except error.WorkerError as inst: | 236 except error.WorkerError as inst: |
235 # Don't print a message -- the worker already should have | 237 # Don't print a message -- the worker already should have |