[Zope-dev] FTP error messages

richard@bizarsoftware.com.au richard@bizarsoftware.com.au
Wed, 21 Feb 2001 13:12:12 +1100


This is a multi-part message in MIME format.
--------------BB302A65CD2FB7DF847C8B72
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

One of our developers just spent another annoying morning trying to figure
why his FTP transfers to Zope were sometimes responding with "426 Error
creating file." with no other information being supplied.

I've now added the ability to set the message to be sent back to the FTP
client on FTPResponse. The patch is attached. We'll be using it and I hope
that it, or something similar, makes it into the 2.3.1.

I'd also hope that the standard PUT methods in the Zope source would set
the message to something useful. At the moment, we set the message to the
type and value of any exception raised in the PUT method.

Of course, if there's a "better" way to do this, please tell me.


     Richard

-- 
Richard Jones
richard@bizarsoftware.com.au
Senior Software Developer, Bizar Software (www.bizarsoftware.com.au)
--------------BB302A65CD2FB7DF847C8B72
Content-Type: application/octet-stream;
 name="xx"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename="xx"

SW5kZXg6IEZUUFJlc3BvbnNlLnB5Cj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KUkNTIGZpbGU6IC9jdnMtcmVw
b3NpdG9yeS9ab3BlMi9aU2VydmVyL0ZUUFJlc3BvbnNlLnB5LHYKcmV0cmlldmluZyByZXZp
c2lvbiAxLjYKZGlmZiAtYyAtcjEuNiBGVFBSZXNwb25zZS5weQoqKiogRlRQUmVzcG9uc2Uu
cHkJMjAwMC8wMy8xNCAxNjoyNjo1MQkxLjYKLS0tIEZUUFJlc3BvbnNlLnB5CTIwMDEvMDIv
MjEgMDI6MDc6NTIKKioqKioqKioqKioqKioqCioqKiAxMjAsMTI1ICoqKioKLS0tIDEyMCwx
MzIgLS0tLQogICAgICBkZWYgX21hcnNoYWxsZWRCb2R5KHNlbGYpOgogICAgICAgICAgcmV0
dXJuIG1hcnNoYWwubG9hZHMoc2VsZi5ib2R5KQogIAorICAgICBkZWYgc2V0T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