[meta] Convert all objective C exception guards to the fatal / aborting versions
Categories
(Core :: Widget: Cocoa, task)
Tracking
()
People
(Reporter: mstange, Unassigned)
References
(Blocks 1 open bug)
Details
(Keywords: meta)
At the moment, we have NS_OBJC_BEGIN/END_TRY_IGNORE_BLOCK
and NS_OBJC_BEGIN/END_TRY_BLOCK_RETURN
macros strewn over much of our Objective C(++) code.
These macros catch Objective C exceptions and then proceed with execution. This means that our code needs to be written with "partial execution" in mind, i.e. we need to think about the program states that we get into if the rest of the function gets skipped due to an exception.
This is an unsafe default. It also makes refactoring harder because one has to think about more failure states.
Early "abandonment" (crashing) is ultimately safer and easier to work with.
We should convert all our exception guards to the "fatal" versions: NS_OBJC_BEGIN_TRY_ABORT_BLOCK
+ NS_OBJC_END_TRY_ABORT_BLOCK
. This means that we will crash on all unexpected objective C exceptions.
From the crash reports, we will be able to tell which exceptions can occur in practice, and we can treat them as "expected" exceptions or change our code such that the exceptions are no longer triggered.
For "expected" exceptions, we should wrap the appropriate calls in manual, tightly-scoped @try {...} @catch (...) {...}
blocks.
This bug tracks converting our code base to the fatal exception guards. We can do it piece by piece, so that we have some time to react to any new crash reports.
Reporter | ||
Updated•4 years ago
|
Reporter | ||
Updated•4 years ago
|
Reporter | ||
Updated•4 years ago
|
Description
•