Merge pull request #4044 from nathanielmanistaatgoogle/exception-str

Add a useful __str__ method to face exceptions
pull/4139/head release-0_11
Masood Malekghassemi 9 years ago
commit 8e269cfd62
  1. 4
      src/python/grpcio/grpc/framework/interfaces/face/face.py

@ -117,6 +117,10 @@ class AbortionError(Exception):
self.code = code self.code = code
self.details = details self.details = details
def __str__(self):
return '%s(code=%s, details="%s")' % (
self.__class__.__name__, self.code, self.details)
class CancellationError(AbortionError): class CancellationError(AbortionError):
"""Indicates that an RPC has been cancelled.""" """Indicates that an RPC has been cancelled."""

Loading…
Cancel
Save