[Zope-Checkins] CVS: Zope/lib/python/ZPublisher - Publish.py:1.158

Andreas Jung andreas@andreas-jung.com
Sun, 2 Feb 2003 07:11:04 -0500


Update of /cvs-repository/Zope/lib/python/ZPublisher
In directory cvs.zope.org:/tmp/cvs-serv7018/lib/python/ZPublisher

Modified Files:
	Publish.py 
Log Message:
- Collector #741: Applied patch to provide better FTP error messages.


=== Zope/lib/python/ZPublisher/Publish.py 1.157 => 1.158 ===
--- Zope/lib/python/ZPublisher/Publish.py:1.157	Wed Aug 14 18:09:40 2002
+++ Zope/lib/python/ZPublisher/Publish.py	Sun Feb  2 07:11:01 2003
@@ -105,6 +105,14 @@
     except:
         if transactions_manager: transactions_manager.abort()
 
+        # DM: provide nicer error message for FTP
+        sm= getattr(response,'setMessage',None)
+        if sm is not None:
+            from ZServer.medusa.asyncore import compact_traceback
+            cl,val= sys.exc_info()[:2]
+            sm('%s: %s %s' % (getattr(cl,'__name__',cl), val, debug_mode and compact_traceback()[-1] or ''))
+         
+
         if err_hook is not None:
             if parents: parents=parents[0]
             try: