26 Mar
Posted by: Christian Wimmer in: JEDI Windows Security Code Lib
Because exceptions are more likely to be noticed.
Nearly all Windows API functions use boolean return values in combination with GetLastError. However a programmer is not binded to check for a return value or use GetLastError. In contrast to return values, exceptions are more shattering. You have to catch them or otherwise the following code will not be executed. Code which is executed but that also depends on a successful call may go crazy and do unpredictable stuff.
However if you are going to do this…
… it is your fault and you should pray that the following code works at all.
One Response
Exception swallowing by JEDI Windows API
06|Apr|2008 1[...] this blog entry “Why JWSCL mainly uses exceptions instead of returned error values” I told you why JWSCL uses mainly exceptions instead of return values. However this design [...]
Leave a reply
You must be logged in to post a comment.