Skip to content

Commit

Permalink
Merge pull request #3125 from input-output-hk/rvl/adp-1432/winsock-er…
Browse files Browse the repository at this point in the history
…ror-codes

Server: Update windows error codes list
  • Loading branch information
rvl authored Feb 11, 2022
2 parents 0ae0c41 + ec78ad2 commit c9109cf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/core/src/Cardano/Wallet/Api/Server.hs
Original file line number Diff line number Diff line change
Expand Up @@ -709,8 +709,9 @@ ioToListenError hostPreference portOpt e
-- Bad hostname -- Linux and Darwin
| isDoesNotExistError e =
Just (ListenErrorHostDoesNotExist hostPreference)
-- Bad hostname (bind: WSAEOPNOTSUPP) -- Windows
| isUserError e && (hasDescription "11001" || hasDescription "10045") =
-- Bad hostname -- Windows
-- WSAHOST_NOT_FOUND, WSATRY_AGAIN, or bind: WSAEOPNOTSUPP
| isUserError e && any hasDescription ["11001", "11002", "10045"] =
Just (ListenErrorHostDoesNotExist hostPreference)
-- Address is valid, but can't be used for listening -- Linux
| show (ioeGetErrorType e) == "invalid argument" =
Expand All @@ -719,8 +720,7 @@ ioToListenError hostPreference portOpt e
| show (ioeGetErrorType e) == "unsupported operation" =
Just (ListenErrorInvalidAddress hostPreference)
-- Address is valid, but can't be used for listening -- Windows
| isOtherError e &&
(hasDescription "WSAEINVAL" || hasDescription "WSAEADDRNOTAVAIL") =
| isOtherError e && any hasDescription ["WSAEINVAL", "WSAEADDRNOTAVAIL"] =
Just (ListenErrorInvalidAddress hostPreference)
-- Listening on an unavailable or privileged port -- Windows
| isOtherError e && hasDescription "WSAEACCESS" =
Expand Down

0 comments on commit c9109cf

Please sign in to comment.