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
Telephus eats tracebacks #8
Comments
This is an artifact of your use of inlineCallbacks. It's a problem with twisted, not telephus. Don't use inlineCallbacks if you don't like this behavior. |
It is not true that if you use inlineCallbacks you will lose every traceback. See the example were i mix normal deferred usage with inlineCallbacks and you do get a traceback. It is not an option for us to drop inlineCallbacks. We use it extensively on our software and we still get proper tracebacks when something occurs.
|
I contend that the real problem is both in Thrift's twisted code (for not starting with meaningful tracebacks) and Twisted's error handling (for being overeager in excising parts of tracebacks between calls to Failure._findFailure and Failure.raiseException, etc). Still, I think the change I just made on the unstable branch (see cb812ec) ought to help you. Try it out. |
When using telephus from code that uses defer.inlineCallbacks, all exceptions show a traceback that is internal to telephus, and they never show the line in my code which generated the error.
Example:
In this example, the output, when run for a second time, will be:
Unhandled error in Deferred:
Traceback (most recent call last):
Failure: telephus.cassandra.ttypes.InvalidRequestException: InvalidRequestException(why='Keyspace already exists.')
I would expect to see the line
yield client.system_add_keyspace(ksdef)
somewhere in the backtrace, but it is not there.But if we uncomment the
#yield error()
line, backtraces show as expected.This issue is specially bad for actions like insert, where you can get a traceback like this:
and never know which part of your code failed.
The text was updated successfully, but these errors were encountered: