Skip to content

Commit 584399d

Browse files
committed
oops, duh
1 parent 27c9969 commit 584399d

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

client.go

+13-5
Original file line numberDiff line numberDiff line change
@@ -800,10 +800,14 @@ func (c *Client) removeFile(path string) error {
800800
}
801801
switch typ {
802802
case sshFxpStatus:
803-
return &PathError{
803+
err = normaliseError(unmarshalStatus(id, data))
804+
if err == nil {
805+
return nil
806+
}
807+
return &os.PathError{
804808
Op: "remove",
805809
Path: path,
806-
Err: normaliseError(unmarshalStatus(id, data)),
810+
Err: err,
807811
}
808812
default:
809813
return unimplementedPacketErr(typ)
@@ -822,10 +826,14 @@ func (c *Client) RemoveDirectory(path string) error {
822826
}
823827
switch typ {
824828
case sshFxpStatus:
825-
return &PathError{
826-
Op: "rmdir",
829+
err = normaliseError(unmarshalStatus(id, data))
830+
if err == nil {
831+
return nil
832+
}
833+
return &os.PathError{
834+
Op: "remove",
827835
Path: path,
828-
Err: normaliseError(unmarshalStatus(id, data)),
836+
Err: err,
829837
}
830838
default:
831839
return unimplementedPacketErr(typ)

0 commit comments

Comments
 (0)