Skip to content

Commit 9649853

Browse files
tklausergopherbot
authored andcommitted
syscall: let errors.ErrUnsupported match ERROR_NOT_SUPPORTED and ERROR_CALL_NOT_IMPLEMENTED
These error codes are returned on windows in case a particular functions is not supported. Updates #41198 Change-Id: Ic31755a131d4e7c96961ba54f5bb51026fc7a563 Reviewed-on: https://go-review.googlesource.com/c/go/+/476916 Auto-Submit: Tobias Klauser <[email protected]> Reviewed-by: Bryan Mills <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> Run-TryBot: Tobias Klauser <[email protected]> TryBot-Result: Gopher Robot <[email protected]>
1 parent 23e8f43 commit 9649853

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/syscall/syscall_windows.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,11 @@ func (e Errno) Error() string {
142142
return string(utf16.Decode(b[:n]))
143143
}
144144

145-
const _ERROR_BAD_NETPATH = Errno(53)
145+
const (
146+
_ERROR_NOT_SUPPORTED = Errno(50)
147+
_ERROR_BAD_NETPATH = Errno(53)
148+
_ERROR_CALL_NOT_IMPLEMENTED = Errno(120)
149+
)
146150

147151
func (e Errno) Is(target error) bool {
148152
switch target {
@@ -162,7 +166,9 @@ func (e Errno) Is(target error) bool {
162166
e == ERROR_PATH_NOT_FOUND ||
163167
e == ENOENT
164168
case errorspkg.ErrUnsupported:
165-
return e == ENOSYS ||
169+
return e == _ERROR_NOT_SUPPORTED ||
170+
e == _ERROR_CALL_NOT_IMPLEMENTED ||
171+
e == ENOSYS ||
166172
e == ENOTSUP ||
167173
e == EOPNOTSUPP ||
168174
e == EWINDOWS

0 commit comments

Comments
 (0)