]> Savannah Git Hosting - gnulib.git/commitdiff
provide the most common gnulib-specific error codes
authorDmitry Selyutin <ghostmansd@gmail.com>
Sun, 27 Aug 2017 11:29:47 +0000 (14:29 +0300)
committerDmitry Selyutin <ghostmansd@gmail.com>
Sun, 27 Aug 2017 11:29:47 +0000 (14:29 +0300)
pygnulib/error.py [new file with mode: 0644]

diff --git a/pygnulib/error.py b/pygnulib/error.py
new file mode 100644 (file)
index 0000000..d618df0
--- /dev/null
@@ -0,0 +1,54 @@
+#!/usr/bin/python
+# encoding: UTF-8
+
+
+
+class AutoconfVersionError(Exception):
+    """minimum supported autoconf version mismatch"""
+    def __init__(self, version):
+        fmt = "minimum supported autoconf version is %f"
+        message = fmt % version
+        super().__init__(message)
+
+
+
+class M4BaseMismatchError(Exception):
+    """<gnulib-comp.m4> is expected to contain gl_M4_BASE([m4base])"""
+    def __init__(self, m4_base):
+        fmt = "<gnulib-comp.m4> is expected to contain gl_M4_BASE([%s])"
+        message = fmt % m4_base
+        super().__init__(message)
+
+
+
+class ConditionalDependenciesUnavailableError(Exception):
+    """conditional dependencies are not supported with tests"""
+    def __init__(self):
+        message = "conditional dependencies are not supported with tests"
+        super().__init__(message)
+
+
+
+class IncompatibleLicenseError(Exception):
+    """incompatible licenses on modules"""
+    def __init__(self, modules):
+        fmt = "incompatible licenses on modules: %r"
+        message = fmt % modules
+        super().__init__(message)
+
+
+
+class EmptyFileListError(Exception):
+    """cannot process empty file list"""
+    def __init__(self):
+        message = "cannot process empty file list"
+        super().__init__(message)
+
+
+
+class UnknownLicenseError(Exception):
+    """module lacks a license"""
+    def __init__(self, module):
+        fmt = "module lacks a license: %r"
+        message = fmt % module
+        super().__init__(message)