@@ -6,15 +6,38 @@ type fxerr uint32
66// direct control of the errors being sent vs. letting the library work them
77// out from the standard os/io errors.
88const (
9- ErrSSHFxOk = fxerr (sshFxOk )
10- ErrSSHFxEOF = fxerr (sshFxEOF )
11- ErrSSHFxNoSuchFile = fxerr (sshFxNoSuchFile )
12- ErrSSHFxPermissionDenied = fxerr (sshFxPermissionDenied )
13- ErrSSHFxFailure = fxerr (sshFxFailure )
14- ErrSSHFxBadMessage = fxerr (sshFxBadMessage )
15- ErrSSHFxNoConnection = fxerr (sshFxNoConnection )
16- ErrSSHFxConnectionLost = fxerr (sshFxConnectionLost )
17- ErrSSHFxOpUnsupported = fxerr (sshFxOPUnsupported )
9+ ErrSSHFxOk = fxerr (sshFxOk )
10+ ErrSSHFxEOF = fxerr (sshFxEOF )
11+ ErrSSHFxNoSuchFile = fxerr (sshFxNoSuchFile )
12+ ErrSSHFxPermissionDenied = fxerr (sshFxPermissionDenied )
13+ ErrSSHFxFailure = fxerr (sshFxFailure )
14+ ErrSSHFxBadMessage = fxerr (sshFxBadMessage )
15+ ErrSSHFxNoConnection = fxerr (sshFxNoConnection )
16+ ErrSSHFxConnectionLost = fxerr (sshFxConnectionLost )
17+ ErrSSHFxOpUnsupported = fxerr (sshFxOPUnsupported )
18+ ErrSSHFxInvalidHandle = fxerr (sshFxInvalidHandle )
19+ ErrSSHFxNoSuchPath = fxerr (sshFxNoSuchPath )
20+ ErrSSHFxFileAlreadyExists = fxerr (sshFxFileAlreadyExists )
21+ ErrSSHFxWriteProtect = fxerr (sshFxWriteProtect )
22+ ErrSSHFxNoMedia = fxerr (sshFxNoMedia )
23+ ErrSSHFxNoSpaceOnFilesystem = fxerr (sshFxNoSpaceOnFilesystem )
24+ ErrSSHFxQuotaExceeded = fxerr (sshFxQuotaExceeded )
25+ ErrSSHFxUnknownPrincipal = fxerr (sshFxUnknownPrincipal )
26+ ErrSSHFxLockConflict = fxerr (sshFxLockConflict )
27+ ErrSSHFxDirNotEmpty = fxerr (sshFxDirNotEmpty )
28+ ErrSSHFxNotADirectory = fxerr (sshFxNotADirectory )
29+ ErrSSHFxInvalidFilename = fxerr (sshFxInvalidFilename )
30+ ErrSSHFxLinkLoop = fxerr (sshFxLinkLoop )
31+ ErrSSHFxCannotDelete = fxerr (sshFxCannotDelete )
32+ ErrSSHFxInvalidParameter = fxerr (sshFxInvalidParameter )
33+ ErrSSHFxFileIsADirectory = fxerr (sshFxFileIsADirectory )
34+ ErrSSHFxByteRangeLockConflict = fxerr (sshFxByteRangeLockConflict )
35+ ErrSSHFxByteRangeLockRefused = fxerr (sshFxByteRangeLockRefused )
36+ ErrSSHFxDeletePending = fxerr (sshFxDeletePending )
37+ ErrSSHFxFileCorrupt = fxerr (sshFxFileCorrupt )
38+ ErrSSHFxOwnerInvalid = fxerr (sshFxOwnerInvalid )
39+ ErrSSHFxGroupInvalid = fxerr (sshFxGroupInvalid )
40+ ErrSSHFxNoMatchingByteRangeLock = fxerr (sshFxNoMatchingByteRangeLock )
1841)
1942
2043// Deprecated error types, these are aliases for the new ones, please use the new ones directly
@@ -48,6 +71,52 @@ func (e fxerr) Error() string {
4871 return "connection lost"
4972 case ErrSSHFxOpUnsupported :
5073 return "operation unsupported"
74+ case ErrSSHFxInvalidHandle :
75+ return "the handle value was invalid"
76+ case ErrSSHFxNoSuchPath :
77+ return "the file path does not exist or is invalid"
78+ case ErrSSHFxFileAlreadyExists :
79+ return "the file already exists"
80+ case ErrSSHFxWriteProtect :
81+ return "the file is on read-only media, or the media is write protected"
82+ case ErrSSHFxNoMedia :
83+ return "the requested operation cannot be completed because there is no media available in the drive"
84+ case ErrSSHFxNoSpaceOnFilesystem :
85+ return "the requested operation cannot be completed because there is insufficient free space on the filesystem"
86+ case ErrSSHFxQuotaExceeded :
87+ return "the operation cannot be completed because it would exceed the user's storage quota"
88+ case ErrSSHFxUnknownPrincipal :
89+ return "a principal referenced by the request (either the 'owner', 'group', or 'who' field of an ACL), was unknown"
90+ case ErrSSHFxLockConflict :
91+ return "the file could not be opened because it is locked by another process"
92+ case ErrSSHFxDirNotEmpty :
93+ return "the directory is not empty"
94+ case ErrSSHFxNotADirectory :
95+ return "the specified file is not a directory"
96+ case ErrSSHFxInvalidFilename :
97+ return "the filename is not valid"
98+ case ErrSSHFxLinkLoop :
99+ return "too many symbolic links encountered or, an SSH_FXF_NOFOLLOW open encountered a symbolic link as the final component"
100+ case ErrSSHFxCannotDelete :
101+ return "the file cannot be deleted"
102+ case ErrSSHFxInvalidParameter :
103+ return "one of the parameters was out of range, or the parameters specified cannot be used together"
104+ case ErrSSHFxFileIsADirectory :
105+ return "the specified file was a directory in a context where a directory cannot be used"
106+ case ErrSSHFxByteRangeLockConflict :
107+ return "a read or write operation failed because another process's mandatory byte-range lock overlaps with the request"
108+ case ErrSSHFxByteRangeLockRefused :
109+ return "a request for a byte range lock was refused"
110+ case ErrSSHFxDeletePending :
111+ return "an operation was attempted on a file for which a delete operation is pending"
112+ case ErrSSHFxFileCorrupt :
113+ return "the file is corrupt; an filesystem integrity check should be run"
114+ case ErrSSHFxOwnerInvalid :
115+ return "the principal specified can not be assigned as an owner of a file"
116+ case ErrSSHFxGroupInvalid :
117+ return "the principal specified can not be assigned as the primary group of a file"
118+ case ErrSSHFxNoMatchingByteRangeLock :
119+ return "the requested operation could not be completed because the specified byte range lock has not been granted"
51120 default :
52121 return "failure"
53122 }
0 commit comments