17 Feb
2010
17 Feb
'10
6:32 p.m.
It's a possibility, but I'm not sure I understand the use case well enough. In the use case you're describing, I would simply make getPath throw if it can't produce a valid string for whatever reason.
Firstly I don't want getKeyPath to throw because: 1) It only adds more info to true failure description (the thrown exception object), so even if it does fail its a lesser error. I just want to skip that info in such case and throw real exception. 2) It is acceptable for it to fail. If the key handle is invalid (because it was prematurely closed for example) then the function fails but it is OK. Again I want to prevent original error. Adam Badura