Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Where do the exceptions go? #53

Open
exarkun opened this issue May 2, 2017 · 3 comments
Open

Where do the exceptions go? #53

exarkun opened this issue May 2, 2017 · 3 comments

Comments

@exarkun
Copy link
Member

exarkun commented May 2, 2017

exctube.txt

I would expect flowStopped to be called on each participant in the flow. It seems that stopped is called on the tube with the buggy received method but the exception doesn't appear to be propagated beyond that.

@glyph
Copy link
Member

glyph commented May 3, 2017

This is definitely a bug. Effectively, the exceptions go nowhere; what's causing even the traceback-printing you're seeing is your own self._operation.addErrback.

There's some logic in tubes._siphon._Siphon._deliverFrom to catch exceptions when calling the started, stopped, and received methods, but the trouble is that usually (as in this case) the errors are raised by next() rather than the method themselves.

This logic should be refactored to apply to any part of the user code raising an exception, and therefore also be called in popPendingValue.

Does this explanation make sense?

BTW, if you're implementing your own IDrain and IFount directly, you probably should have a look at tubes.kit, particularly beginFlowingFrom and beginFlowingTo. (Yes, I know they need more docs...)

@Julian
Copy link
Member

Julian commented Jul 22, 2017

I assume this is the same issue -- you can trigger something like this as simply as having a tube that is:

@tube
class Reverser(object):
    def received(self, item):
        asdf

Sticking that into a series appears to just silently fail.

@glyph
Copy link
Member

glyph commented Jul 23, 2017

Yep, definitely a bug. A fix would be much appreciated :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants