diff resfinder/cge/output/exceptions.py @ 0:55051a9bc58d draft default tip

Uploaded
author dcouvin
date Mon, 10 Jan 2022 20:06:07 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/resfinder/cge/output/exceptions.py	Mon Jan 10 20:06:07 2022 +0000
@@ -0,0 +1,17 @@
+#!/usr/bin/env python3
+
+
+class DuplicateKeyError(Exception):
+    """ Raise when adding the same key to a dict twice."""
+    def __init__(self, message, *args):
+        self.message = message
+        # allow users initialize misc. arguments as any other builtin Error
+        super(DuplicateKeyError, self).__init__(message, *args)
+
+
+class LockedObjectError(Exception):
+    """ Raise when attempting to alter a locked object."""
+    def __init__(self, message, *args):
+        self.message = message
+        # allow users initialize misc. arguments as any other builtin Error
+        super(LockedObjectError, self).__init__(message, *args)