Îõ³h&.÷5      !"#$%&'()*+,-./01234 Safe-Inferred5 Safe-Inferredñ6 Win32-errors"Given something like [(undefined, Successý)], the following will be produced: data ErrCode = Success | Other !DWORD deriving (Eq, Show)678 Safe-Inferred5  Win32-errorsáWin32 actions typically return an error code to indicate success or failure. These codes are intended to be globally unique, though there may be some overlap. MSDN documents which errors may be returned by any given action.ÓThe naming of errors follows a convention. An error such as ERROR_SUCCESS becomes , ERROR_FILE_NOT_FOUND becomes Þ, and so on. There are thousands of errors, so it would be impractical to add them all. The &Ò constructor is used to represent error codes which are not handled specifically.»User's of this library are encouraged to submit new error codes. Add new entries to System.Win32.Errors.Mapping. Send your pull requests along with a link to relevent documentation to  0https://github.com/mikesteele81/Win32-errors.git0https://github.com/mikesteele81/Win32-errors.git.' Win32-errors Convert an  into a 9.( Win32-errors Exception type for Win32 errors.ÆThis type will be thrown as an extensible exception when a foreign call out to part of the Win32 indicates that an error has occurred. In most cases you should wrap an IO computation in a call to ..&The following example uses the custom  createFile function described in System.Win32.Error.Foreign: †eHandle <- do h <- E.tryWin32 $ createFile "c:\\missing.txt" gENERIC_READ oPEN_EXISTING -- perform other actions return h case eHandle of Right handle -> do -- do something with the file handle Left w32Err -> do case E.errCode w32Err of E.InvalidHandle -> do -- perform cleanup -- handle other error codes. T.putStrLn $ E.systemMessage w32Err* Win32-errors2The foreign action which triggered this exception.+ Win32-errorsThe error code, Win32-errors;The standard system message associated with the error code.- Win32-errors Convert a 9 into an Ï. Values which don't have a corresponding constructor will end up becoming an &.. Win32-errorsËActions calling out to Win32 may throw exceptions. Wrapping the action in . will catch (Æ exceptions, but will allow any other exception type to pass through.: Win32-errors/Performs marshalling by converting to and from 9./&%$#"!  '(),*+-. Trustworthy!e/ Win32-errors*This function mirrors the Win32 package's  function.0 Win32-errorsÜCopied from the Win32 package. Use this to throw a Win32 exception when an action returns a value satisfying the given predicate. The exception thrown will depend on a thead-local global error condition. The supplied ;Ø value should be set to the human-friendly name of the action that triggered the error.1 Win32-errors*This function mirrors the Win32 package's  function.2 Win32-errors)Perform the supplied action, and throw a (6 exception if the return code is anything other than !. The supplied action returns a 9 instead of an 8 so that foreign imports can be used more conveniently.3 Win32-errorsâWindows maintains a thread-local value representing the previously triggered error code. Calling 3% will look up the value, and throw a ( exception. The supplied ;Ù argument should be set to the name of the function which triggered the error condition.ÿCalling this action when no error has occurred (0x00000000 -- ERROR_SUCCESS) will result in an exception being thrown for the  error code.< Win32-errors:Like failWith, but avoid multiple conversions to and from .4 Win32-errorsThrow a (6 exception for the given function name and error code.= Win32-errors«This function doesn't belong in Win32-errors, which is why it isn't exported. FormatMessage is required to get the standard system message associated with an error code./012340/1243 Trustworthy•/  !"#$%&'()+*,-./()+*,.'-  !"#$%&>      !"#$%&'()*+,-./01123456789:;<=>?@ABCDEFÇWin32-errors-0.2.2.6-inplaceSystem.Win32.ErrorSystem.Win32.Error.ForeignSystem.Win32.Error.MappingSystem.Win32.Error.THSystem.Win32.Error.TypesSystem.Win32.Types failIfFalse_ failIfNullErrCodeInvalidHandleValueSuccess FileNotFound PathNotFound AccessDenied InvalidHandle InvalidData InvalidDriveCurrentDirectory NoMoreFilesCallNotImplementedMoreData NoMoreItemsServiceAlreadyRunningServiceDisabledServiceDoesNotExistServiceCannotAcceptCtrlServiceNotActiveFailedServiceControllerConnectExceptionInServiceServiceSpecificErrorServiceNotInExeRPCSServerUnavailableRPCSServerTooBusyNotAReparsePointDhcpSubnetNotPresentDhcpElementCantRemoveDhcpOptionNotPresent DhcpJetErrorDhcpNotReservedClientDhcpReservedClientDhcpIprangeExistsDhcpReservedipExistsDhcpInvalidRangeDhcpIprangeConvIllegalScopeRangePolicyRangeConflictDhcpFoIprangeTypeConvIllegalOthertoDWORDWin32ExceptionfunctionerrCode systemMessage fromDWORDtryWin32failIffailUnlessSuccesserrorWinfailWithmapping genErrCode gentoDWORD genfromDWORD7Win32-2.10.1.1-04174505ee1439c3b44b06d3dbe737507c53cb2eDWORD$fStorableErrCode text-1.2.5.0Data.Text.InternalText failWith' formatMessage