Changeset - e4169e84981a
[Not reviewed]
0 1 0
Lance Edgar - 9 years ago 2015-08-16 19:30:00
ledgar@sacfoodcoop.com
Add custom errors for when SA / Python for Windows Extensions not installed.
1 file changed with 26 insertions and 0 deletions:
0 comments (0 inline, 0 general)
rattail/exceptions.py
Show inline comments
 
@@ -38,12 +38,38 @@ class RattailError(Exception):
 
class ConfigurationError(RattailError):
 
    """
 
    Generic class for configuration errors.
 
    """
 

	
 

	
 
class SQLAlchemyNotInstalled(RattailError):
 
    """
 
    Error raised when an operation is requested which requires SQLAlchemy
 
    (and/or related libraries) to be installed, but they are not available.
 
    """
 
    def __init__(self, error):
 
        self.error = error
 

	
 
    def __unicode__(self):
 
        return ("Hm, looks like SQLAlchemy may not be installed?  "
 
                "(Perhaps you should do: 'pip install rattail[db]'?)  "
 
                "Original error was: {0}".format(self.error))
 

	
 

	
 
class WindowsExtensionsNotInstalled(RattailError):
 
    """
 
    Error raised when an operation is requested which requires the "Python for
 
    Windows Extensions" to be instealled, but it is not available.
 
    """
 

	
 
    def __unicode__(self):
 
        return ("Cannot proceed because Python for Windows Extensions is not installed.  Please see "
 
                "https://rattailproject.org/moin/Installation/Windows/Python#Python_for_Windows_Extensions "
 
                "for more info.")
 

	
 

	
 
class SenderNotFound(ConfigurationError):
 

	
 
    def __init__(self, key):
 
        self.key = key
 

	
 
    def __unicode__(self):
0 comments (0 inline, 0 general)