w32
w32 copied to clipboard
Does this package need panic when error is return or just return the error?
GetClientRect panic when error is return. ReleaseDC return false when error is return. CreateWindowEx return null and ignore the real error message. (I have verified the GetLastError api will not return error when this api fail.)
Here is my suggest:
- Use MustGetClientRect to show the this function will panic when error is return.(so the caller can not simple ignore the error, it will stop the program when the error occured. the caller can ignore it will recover )
- Use GetClientRect return a error type to show if there is an error. (so the caller can ignore it easier)
I have an actively maintained fork which I use to create both 32 and 64 bit applications, both for work and for private projects. I have been wanting to remove those panics for a long time and now finally I have, replacing it with simply doing nothing where they did not make sense in the first place or returning an error additionally from functions:
https://github.com/gonutz/w32