diff options
author | Nathaniel Manista <nathaniel@google.com> | 2015-11-04 21:47:31 +0000 |
---|---|---|
committer | Nathaniel Manista <nathaniel@google.com> | 2015-11-04 21:47:31 +0000 |
commit | 51741d20e3341a0d381360491a65c4014fa80f03 (patch) | |
tree | 394d7f87d18ab54bb9c2d5b30d8c5ebfbd2c247d /src | |
parent | e745ff2c3f764ee2a56a54a290b6cf7dadb481d5 (diff) |
Add a useful __str__ method to face exceptions
Diffstat (limited to 'src')
-rw-r--r-- | src/python/grpcio/grpc/framework/interfaces/face/face.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/python/grpcio/grpc/framework/interfaces/face/face.py b/src/python/grpcio/grpc/framework/interfaces/face/face.py index bc9a434a76..3b402356d2 100644 --- a/src/python/grpcio/grpc/framework/interfaces/face/face.py +++ b/src/python/grpcio/grpc/framework/interfaces/face/face.py @@ -117,6 +117,10 @@ class AbortionError(Exception): self.code = code self.details = details + def __str__(self): + return '%s(code=%s, details="%s")' % ( + self.__class__.__name__, self.code, self.details) + class CancellationError(AbortionError): """Indicates that an RPC has been cancelled.""" |