aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Nathaniel Manista <nathaniel@google.com>2015-11-04 21:47:31 +0000
committerGravatar Nathaniel Manista <nathaniel@google.com>2015-11-04 21:47:31 +0000
commit51741d20e3341a0d381360491a65c4014fa80f03 (patch)
tree394d7f87d18ab54bb9c2d5b30d8c5ebfbd2c247d /src
parente745ff2c3f764ee2a56a54a290b6cf7dadb481d5 (diff)
Add a useful __str__ method to face exceptions
Diffstat (limited to 'src')
-rw-r--r--src/python/grpcio/grpc/framework/interfaces/face/face.py4
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."""