From 51741d20e3341a0d381360491a65c4014fa80f03 Mon Sep 17 00:00:00 2001 From: Nathaniel Manista Date: Wed, 4 Nov 2015 21:47:31 +0000 Subject: [PATCH] Add a useful __str__ method to face exceptions --- src/python/grpcio/grpc/framework/interfaces/face/face.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/python/grpcio/grpc/framework/interfaces/face/face.py b/src/python/grpcio/grpc/framework/interfaces/face/face.py index bc9a434a760..3b402356d2d 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."""