Returns a textproto.Error

It easier for the client to extract the code and message with type assertions.
This commit is contained in:
jlaffaye 2011-09-06 19:15:39 +02:00
parent af6f5aac6a
commit 68f080c45f

2
ftp.go
View File

@ -130,7 +130,7 @@ func (c *ServerConn) cmdDataConn(format string, args ...interface{}) (net.Conn,
} }
if code != StatusAlreadyOpen && code != StatusAboutToSend { if code != StatusAlreadyOpen && code != StatusAboutToSend {
conn.Close() conn.Close()
return nil, os.NewError(fmt.Sprintf("%d %s", code, msg)) return nil, &textproto.Error{code, msg}
} }
return conn, nil return conn, nil