|
75 | 75 | import com.google.cloud.spanner.encryption.CustomerManagedEncryption; |
76 | 76 | import com.google.cloud.spanner.v1.stub.SpannerStubSettings; |
77 | 77 | import com.google.common.base.Function; |
| 78 | +import com.google.common.base.Joiner; |
78 | 79 | import com.google.common.base.Preconditions; |
79 | 80 | import com.google.common.collect.Lists; |
80 | 81 | import com.google.common.util.concurrent.ThreadFactoryBuilder; |
@@ -191,6 +192,16 @@ public CloudClientExecutor(boolean enableGrpcFaultInjector) { |
191 | 192 | this.enableGrpcFaultInjector = enableGrpcFaultInjector; |
192 | 193 | } |
193 | 194 |
|
| 195 | + // Helper for unexpected results. |
| 196 | + public static String unexpectedExceptionResponse(Exception e) { |
| 197 | + return "Unexpected error in Github Cloud Java Client Executor: " |
| 198 | + + e |
| 199 | + + " Msg: " |
| 200 | + + e.getMessage() |
| 201 | + + " Stack: " |
| 202 | + + Joiner.on("\n").join(e.getStackTrace()); |
| 203 | + } |
| 204 | + |
194 | 205 | /** |
195 | 206 | * Implementation of a ReadWriteTransaction, which is a wrapper of the cloud TransactionRunner. It |
196 | 207 | * stores all the status and related variables from the start to finish, and control the running |
@@ -1083,7 +1094,7 @@ private Status executeCreateCloudInstance( |
1083 | 1094 | return sender.finishWithError( |
1084 | 1095 | toStatus( |
1085 | 1096 | SpannerExceptionFactory.newSpannerException( |
1086 | | - ErrorCode.INVALID_ARGUMENT, "Unexpected error: " + e.getMessage()))); |
| 1097 | + ErrorCode.INVALID_ARGUMENT, CloudClientExecutor.unexpectedExceptionResponse(e)))); |
1087 | 1098 | } |
1088 | 1099 | return sender.finishWithOK(); |
1089 | 1100 | } |
|
0 commit comments