4 ms·
I don’t understand the point of exception groups
by thatxliner 3y ago
I don’t understand the point of exception groups
- PebblesHD 3y agoThreaded or asynchronous tasks can have multiple exceptions result from a single source event, think 2/5 tasks having a problem. Currently there’s a few library specific ways to handle this and the Python team want to standardise.
- thatxliner 3y agoWhat’s wrong with the `except (Exception, OtherException):` syntax
- koromak 3y agoThe exception groups wrap multiple tasks. Each task can throw one exception. The group is capable of catching all of them. Before with asyncio, it would exit on first exception. You're example is: "catch the first exception of either type (A,B)", exception groups are: "catch all exceptions, of either type (A,B)"
- Already__Taken 3y agoif a user uploads a graph of information, it could validate parts of the edge conditions and return all the incorrect edges to be resolved. previously you'd have to return an errors list around you kept appending during processing.