Ticket #2732 (closed enhancement: invalid)
foolscap: find actual exception types in CopiedFailure
| Reported by: | strank | Owned by: | warner |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | foolscap | Keywords: | |
| Cc: | strank | Branch: | |
| Author: | Launchpad Bug: |
Description
The patch adds a mechanism for replacing the string representation of an exception type (that got sent over the wire) with the actual exception type. This is limited to "known" exceptions, currently those in exceptions and those in foolscap.tokens.
Other exceptions are represented by a new Exception subclass. (I prefer that but it is not necessary for the rest of the patch.)
This change gets rid of copyable.RemoteCopyOldStyle, and copyable._RemoteCopyBase could go too.
What prompted the change: I used foolscap inside an inlineCallbacks generator. There, a CopiedFailure became a string exception called "exceptions.KeyError" and escaped my except Exception: clause - which took me some time to figure out. ;-)

