Skip to content

Commit 63dbfdf

Browse files
committed
Don't translate StatusPacket to os.Err(NotExist|Permission)
Doing this loses potentially useful information for the client. They should instead check with errors.Is(err, fs.ErrNotExist), etc.; the StatusPacket type has an Is method for this already.
1 parent e55eb41 commit 63dbfdf

1 file changed

Lines changed: 0 additions & 4 deletions

File tree

client.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -490,10 +490,6 @@ func statusToError(status *sshfx.StatusPacket, okExpected bool) error {
490490

491491
case sshfx.StatusEOF:
492492
return io.EOF
493-
case sshfx.StatusNoSuchFile:
494-
return fs.ErrNotExist
495-
case sshfx.StatusPermissionDenied:
496-
return fs.ErrPermission
497493
}
498494

499495
return status

0 commit comments

Comments
 (0)