Changeset 58560d2


Ignore:
Timestamp:
Jun 26, 2026, 1:50:40 PM (15 hours ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
master
Parents:
63917ab
Message:

Added to the Assertion Like Exceptions proposal, just a little section to address checked exception concerns.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/proposals/exceptions-assert.md

    r63917ab r58560d2  
    649649enough for a user facing error message.
    650650
     651### THE CHECKED EXCEPTION PROBLEM
     652Yes, this gets an all caps title (it almost got its own section) because the
     653single biggest concern about this system is the additional workload of
     654maintaining checked exception lists on all functions. This is a real concern
     655but I believe this proposal avoids the worst of it.
     656
     657One part of "the worst of it" is the annotating of many functions that call
     658some distant helper function that throws an unhandled exception.
     659At this point, it can be impossible to preform any sort of detailed recovery.
     660In these cases the exceptions should be converted to cancellations.
     661
     662In my experiance the majority of exception throws (writen, not fired) are
     663effectively assertion failures that are only catchable exceptions out of
     664princible (or are in a long running program were individual operations can
     665just be written off). Cancellation replaces all of these cases instead of
     666the new exception system.
     667
     668Another part is the interaction with higher order functions.
     669If a higher order function only works with particular exceptions thrown from
     670the function passed to it, it loses a lot of its flexibility.
     671Both polymorphism and exception tunnelling are ways to address this problem.
     672These stratagies both mean you don't need many different variations of those
     673functions, and hopefully have little (or no) additional code.
     674
    651675### Default Exception Handlers
    652676Handling every exception has often proven more work than people want to put
Note: See TracChangeset for help on using the changeset viewer.