October 30th, 2011, 6:34 pm
QuoteOriginally posted by: rmaxWe seem to be having some design decisions around the error handling be owned by the caller, and not the recipient. Is this a decision?I think there are thousands of viewpoints on this subject; the following are strategies:QuoteThere are several levels of exception safety:1. Failure transparency, also known as the no throw guarantee: Operations are guaranteed to succeed and satisfy all requirements even in presence of exceptional situations. If an exception occurs, it will not throw the exception further up. (Best level of exception safety.) 2. Commit or rollback semantics, also known as strong exception safety or no-change guarantee: Operations can fail, but failed operations are guaranteed to have no side effects so all data retain original values.[2] 3. Basic exception safety: Partial execution of failed operations can cause side effects, but invariants on the state are preserved. Any stored data will contain valid values even, if data has different values now from before the exception. 4. Minimal exception safety also known as no-leak guarantee: Partial execution of failed operations may store invalid data, but will not cause a crash, and no resources get leaked. 5. No exception safety: No guarantees are made (Worst level of exception safety). And do we use try-catch blocks or ERRNO stuff? And exceptions are not the same as failures, according to Bertrand Meyer.
Last edited by
Cuchulainn on October 29th, 2011, 10:00 pm, edited 1 time in total.