From cb2d751cea12bc701f88e381f47b773867e180f4 Mon Sep 17 00:00:00 2001 From: Ryan Leckey Date: Wed, 10 Jul 2013 01:03:01 -0700 Subject: [PATCH] Add an ImproperlyConfigured exception. - To be used to signal when a type is being used without a required library. --- sqlalchemy_utils/__init__.py | 2 ++ sqlalchemy_utils/exceptions.py | 8 ++++++++ 2 files changed, 10 insertions(+) create mode 100644 sqlalchemy_utils/exceptions.py diff --git a/sqlalchemy_utils/__init__.py b/sqlalchemy_utils/__init__.py index f18b14e..cf659af 100644 --- a/sqlalchemy_utils/__init__.py +++ b/sqlalchemy_utils/__init__.py @@ -1,3 +1,4 @@ +from .exceptions import ImproperlyConfigured from .functions import ( sort_query, defer_except, escape_like, primary_keys, table_name ) @@ -26,6 +27,7 @@ __version__ = '0.14.4' __all__ = ( + ImproperlyConfigured, coercion_listener, sort_query, defer_except, diff --git a/sqlalchemy_utils/exceptions.py b/sqlalchemy_utils/exceptions.py new file mode 100644 index 0000000..6744366 --- /dev/null +++ b/sqlalchemy_utils/exceptions.py @@ -0,0 +1,8 @@ +"""Global SQLAlchemy-Utils exception classes. +""" + +class ImproperlyConfigured(Exception): + """ + SQLAlchemy-Utils is improperly configured; normally due to usage of + a utility that depends on a missing library. + """