From 68f080c45feeb25e6bdef96a6a6f371ccff6180e Mon Sep 17 00:00:00 2001 From: jlaffaye Date: Tue, 6 Sep 2011 19:15:39 +0200 Subject: [PATCH] Returns a textproto.Error It easier for the client to extract the code and message with type assertions. --- ftp.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ftp.go b/ftp.go index 648c90e..b0f6979 100644 --- a/ftp.go +++ b/ftp.go @@ -130,7 +130,7 @@ func (c *ServerConn) cmdDataConn(format string, args ...interface{}) (net.Conn, } if code != StatusAlreadyOpen && code != StatusAboutToSend { conn.Close() - return nil, os.NewError(fmt.Sprintf("%d %s", code, msg)) + return nil, &textproto.Error{code, msg} } return conn, nil