Exception handling
Exception handling
- Subject: Exception handling
- From: Casey McDermott <email@hidden>
- Date: Thu, 14 Jun 2018 02:22:36 +0000 (UTC)
We are updating a large Carbon accounting app to Cocoa. There is a ton of
C++ model-layer code. It originally was based on PowerPlant, but the new
interface is Objective-C
with many bridges to the C++.
Our Carbon event loop had a try/catch block, which caught most exceptions, and
then
continued. It started as an expedient in early production, but it remained in
production code
since it often allows users to continue, save their work, etc.
I know this is not standard use of C++ exceptions, but it has worked extremely
well for a couple decades,
on both Mac & Windows.There are a few thousand sanity checks which give a
message and
then throw. The error msg gives file & code line so it makes bug fixes very
easy.
Most asserts will never be called, so we don't want to clutter the code with
try/catch blocks.
Nearly always, the event loop is the best place to escape to.
Is there a way to override the event loop in Cocoa? Some other way we can
escape to
the event loop and then continue from there?
Thanks,
Casey McDermott
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden