changeset 30573:b0ebab239f90

error: add ProgrammingError We have requirement to express "this is clearly an error caused by the programmer". The code base uses RuntimeError for that in some places, not ideal. So let's add a formal exception for that.
author Jun Wu <quark@fb.com>
date Tue, 06 Dec 2016 14:57:47 +0000
parents cfb227016d01
children f8c9a7d2bbbf
files mercurial/error.py
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/error.py	Mon Dec 05 21:36:35 2016 +0000
+++ b/mercurial/error.py	Tue Dec 06 14:57:47 2016 +0000
@@ -168,6 +168,9 @@
 class PushRaced(RuntimeError):
     """An exception raised during unbundling that indicate a push race"""
 
+class ProgrammingError(RuntimeError):
+    """Raised if a developer has made some mistake"""
+
 # bundle2 related errors
 class BundleValueError(ValueError):
     """error raised when bundle2 cannot be processed"""