From e1ae25c8c47d25c9d5184c1f52d6e8ec26cd40f0 Mon Sep 17 00:00:00 2001 From: zhangkun Date: Fri, 8 Aug 2014 22:39:39 -0700 Subject: [PATCH] Makes the Status-generated exceptions contain the status code. ------------- Created by MOE: http://code.google.com/p/moe-java MOE_MIGRATED_REVID=72950983 --- core/src/main/java/com/google/net/stubby/Status.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/com/google/net/stubby/Status.java b/core/src/main/java/com/google/net/stubby/Status.java index d491cf68ab..6b6de600f0 100644 --- a/core/src/main/java/com/google/net/stubby/Status.java +++ b/core/src/main/java/com/google/net/stubby/Status.java @@ -95,7 +95,7 @@ public class Status { private final Status status; public OperationException(Status status) { - super(status.getDescription(), status.getCause()); + super(status.getCode() + ": " + status.getDescription(), status.getCause()); this.status = status; } @@ -112,7 +112,7 @@ public class Status { private final Status status; public OperationRuntimeException(Status status) { - super(status.getDescription(), status.getCause()); + super(status.getCode() + ": " + status.getDescription(), status.getCause()); this.status = status; }