nicer error message

This commit is contained in:
meejah
2015-03-19 00:15:03 -06:00
parent d34e32432d
commit b488ef49b2

View File

@@ -60,7 +60,8 @@ def reject_future(future, error=None):
print("FIXME: passing Exception to reject_future")
error = Failure(error)
else:
assert isinstance(error, IFailedPromise)
if not isinstance(error, IFailedPromise):
raise RuntimeError("reject_future requires an IFailedPromise")
future.errback(error)