Skip to content

Commit ed62aa6

Browse files
authored
fix: add error details for INTERNAL error (#2413)
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: - [ ] Make sure to open an issue as a [bug/issue](https://togithub.com/googleapis/java-spanner/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea - [ ] Ensure the tests and linter pass - [ ] Code coverage does not decrease (if any source code was changed) - [ ] Appropriate docs were updated (if necessary) Fixes #<issue_number_goes_here> ☕️ If you write sample code, please follow the [samples format]( https://togithub.com/GoogleCloudPlatform/java-docs-samples/blob/main/SAMPLE_FORMAT.md).
1 parent afcc598 commit ed62aa6

File tree

1 file changed

+2
-1
lines changed
  • google-cloud-spanner-executor/src/main/java/com/google/cloud/executor/spanner

1 file changed

+2
-1
lines changed

google-cloud-spanner-executor/src/main/java/com/google/cloud/executor/spanner/CloudExecutor.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,8 @@ protected Status toStatus(SpannerException e) {
428428
case CANCELLED:
429429
return Status.fromCode(Status.CANCELLED.getCode()).withDescription(e.getMessage());
430430
case INTERNAL:
431-
return Status.fromCode(Status.INTERNAL.getCode()).withDescription(e.getMessage());
431+
return Status.fromCode(Status.INTERNAL.getCode())
432+
.withDescription(e.getMessage() + e.getReason() == null ? "" : ": " + e.getReason());
432433
case FAILED_PRECONDITION:
433434
return Status.fromCode(Status.FAILED_PRECONDITION.getCode())
434435
.withDescription(e.getMessage());

0 commit comments

Comments
 (0)