Adding GetNoBits error for the Get command
This commit is contained in:
parent
24b0a634d8
commit
1673aac845
2 changed files with 7 additions and 3 deletions
|
@ -41,10 +41,9 @@ func SendFile(c net.Conn, path string) (int, error) {
|
||||||
log.Println(err)
|
log.Println(err)
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
// How is this even possible?
|
// This happens when the user ties to get the current directory
|
||||||
if n == 0 {
|
if n == 0 {
|
||||||
log.Println("0 bits written for:", path)
|
return 0, GetNoBitsError
|
||||||
return 0, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return n, nil
|
return n, nil
|
||||||
|
|
|
@ -19,3 +19,8 @@ var (
|
||||||
TooManyArguments = errors.New("Too many arguments.")
|
TooManyArguments = errors.New("Too many arguments.")
|
||||||
TooFewArguments = errors.New("Too few arguments.")
|
TooFewArguments = errors.New("Too few arguments.")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Command Errors
|
||||||
|
var (
|
||||||
|
GetNoBitsError = errors.New("The file/directory contains zero bits!")
|
||||||
|
)
|
Loading…
Reference in a new issue