I have a object which has a
Drop impl which performs a, maybe failing, action. Is there a possibility to return a error condition somehow?
panic! is a bit too aggressive for this purpose, as it’s not uncommon that the action fails.
The object is sharing a
ctx struct, I thought of setting an error flag there which can be checked, just like C’s
errno. Is there some more elegant way or pattern of doing this? Perhaps by creating a proxy object on creation with which the error can be delivered?
The code is here