X-Git-Url: https://code.octet-stream.net/netwatcher/blobdiff_plain/ddd2c284f693954108371767a183b430b93a7b72..cc86d4310fa2b8af2675e82004facc1d90ef6922:/src/watch_win.rs?ds=sidebyside diff --git a/src/watch_win.rs b/src/watch_win.rs index 3a4a301..a247916 100644 --- a/src/watch_win.rs +++ b/src/watch_win.rs @@ -65,10 +65,10 @@ pub(crate) fn watch_interfaces( // Then return the handle Ok(WatchHandle { hnd, _state: state }) } - ERROR_INVALID_HANDLE => Err(Error::Internal), - ERROR_INVALID_PARAMETER => Err(Error::Internal), - ERROR_NOT_ENOUGH_MEMORY => Err(Error::Internal), - _ => Err(Error::Internal), // TODO: Use FormatMessage and get real error + ERROR_INVALID_HANDLE => Err(Error::InvalidHandle), + ERROR_INVALID_PARAMETER => Err(Error::InvalidParameter), + ERROR_NOT_ENOUGH_MEMORY => Err(Error::NotEnoughMemory), + _ => Err(Error::UnexpectedWindowsResult(res.0)), } }