summaryrefslogtreecommitdiffstats
path: root/openstack/common/db/common.py
diff options
context:
space:
mode:
Diffstat (limited to 'openstack/common/db/common.py')
-rw-r--r--openstack/common/db/common.py44
1 files changed, 44 insertions, 0 deletions
diff --git a/openstack/common/db/common.py b/openstack/common/db/common.py
new file mode 100644
index 0000000..8f6968f
--- /dev/null
+++ b/openstack/common/db/common.py
@@ -0,0 +1,44 @@
+# vim: tabstop=4 shiftwidth=4 softtabstop=4
+
+# Copyright 2010 United States Government as represented by the
+# Administrator of the National Aeronautics and Space Administration.
+# All Rights Reserved.
+# Copyright 2012 Cloudscaling Group, Inc
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+from openstack.common.gettextutils import _
+from openstack.common import log as logging
+
+
+LOG = logging.getLogger(__name__)
+
+
+class Invalid(Exception):
+ pass
+
+
+class InvalidSortKey(Invalid):
+ message = _("Sort key supplied was not valid.")
+
+
+class InvalidUnicodeParameter(Invalid):
+ message = _("Invalid Parameter: "
+ "Unicode is not supported by the current database.")
+
+
+class DBError(Exception):
+ """Wraps an implementation specific exception."""
+ def __init__(self, inner_exception=None):
+ self.inner_exception = inner_exception
+ super(DBError, self).__init__(str(inner_exception))