From 63dbfdfd192247274445ea7d812e7d90872aea3a Mon Sep 17 00:00:00 2001 From: greatroar <61184462+greatroar@users.noreply.github.com> Date: Sat, 31 May 2025 14:15:23 +0200 Subject: [PATCH] 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. --- client.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/client.go b/client.go index c6d818a0..cbd6ca7f 100644 --- a/client.go +++ b/client.go @@ -490,10 +490,6 @@ func statusToError(status *sshfx.StatusPacket, okExpected bool) error { case sshfx.StatusEOF: return io.EOF - case sshfx.StatusNoSuchFile: - return fs.ErrNotExist - case sshfx.StatusPermissionDenied: - return fs.ErrPermission } return status