소스 검색

Returns a textproto.Error

It easier for the client to extract the code and message with type assertions.
jlaffaye 14 년 전
부모
커밋
68f080c45f
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      ftp.go

+ 1 - 1
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