module Web.Harp.Error ( HarpError(..) , getError ) where import Foreign.C.String import Foreign.Storable import Web.Harp.Foreign newtype HarpError = HarpError String deriving (Show, Eq) -- | Get the error message for the error number specified in @harp_errno@. getError :: IO HarpError getError = do errnoC <- peek harpErrnoPtr strC <- harpStrerrorC errnoC str <- peekCString strC return $ HarpError str