|
|
CVS: tmda/TMDA Errors.py,NONE,1.1 ChangeLog,1.111,1.112: msg#00057
|
Subject: |
CVS: tmda/TMDA Errors.py,NONE,1.1 ChangeLog,1.111,1.112 |
Update of /cvsroot/tmda/tmda/TMDA
In directory usw-pr-cvs1:/tmp/cvs-serv12034/TMDA
Modified Files:
ChangeLog
Added Files:
Errors.py
Log Message:
Handle missing environment variables more gracefully. Now, if SENDER
or RECIPIENT is not in the environment, tmda-filter raises an
exception right away which prints a warning and defers delivery.
Also introduce Errors.py which will hold all of TMDA's custom
exceptions.
--- NEW FILE ---
# -*- python -*-
"""Shared TMDA errors and messages."""
import sys
import Defaults
# exception classes
class TMDAError(Exception):
"""Base class for all TMDA exceptions."""
pass
class MissingEnvironmentVariable(TMDAError):
"""An essential environment variable is not defined."""
def __init__(self, varname):
TMDAError.__init__(self)
self.varname = varname
print 'Missing environment variable:', self.varname
sys.exit(Defaults.EX_TEMPFAIL)
Index: ChangeLog
===================================================================
RCS file: /cvsroot/tmda/tmda/TMDA/ChangeLog,v
retrieving revision 1.111
retrieving revision 1.112
diff -u -r1.111 -r1.112
--- ChangeLog 2001/12/17 23:31:47 1.111
+++ ChangeLog 2001/12/20 23:57:04 1.112
@@ -1,3 +1,7 @@
+2001-12-20 Jason R. Mastaler <jasonrm@xxxxxxxxxxxxxxxxxxxxxxxxxx>
+
+ * Errors.py: New module to hold TMDA custom exceptions.
+
2001-12-17 Matt Armstrong <matt@xxxxxxxxxx>
* Cookie.py (make_keyword_cookie): Substitute '?' for keyword
_______________________________________________
tmda-cvs mailing list
http://libertine.org/lists/listinfo/tmda-cvs
|
| |