diff --git a/server/server/commands.go b/server/server/commands.go index adcd341..c0c05fd 100644 --- a/server/server/commands.go +++ b/server/server/commands.go @@ -41,10 +41,9 @@ func SendFile(c net.Conn, path string) (int, error) { log.Println(err) return 0, err } - // How is this even possible? + // This happens when the user ties to get the current directory if n == 0 { - log.Println("0 bits written for:", path) - return 0, nil + return 0, GetNoBitsError } return n, nil diff --git a/server/server/errors.go b/server/server/errors.go index 958a230..b50d544 100644 --- a/server/server/errors.go +++ b/server/server/errors.go @@ -19,3 +19,8 @@ var ( TooManyArguments = errors.New("Too many arguments.") TooFewArguments = errors.New("Too few arguments.") ) + +// Command Errors +var ( + GetNoBitsError = errors.New("The file/directory contains zero bits!") +) \ No newline at end of file