Skip to content
This repository was archived by the owner on Apr 7, 2026. It is now read-only.

Commit 2dbe3cf

Browse files
authored
feat: add public method to get gRPC status code (#25)
Fixes #14.
1 parent 93c0aed commit 2dbe3cf

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

  • google-cloud-spanner/src/main/java/com/google/cloud/spanner

β€Žgoogle-cloud-spanner/src/main/java/com/google/cloud/spanner/ErrorCode.javaβ€Ž

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ Status getGrpcStatus() {
6969
return this.code.toStatus();
7070
}
7171

72+
/** @return the corresponding gRPC status code of this {@link ErrorCode}. */
73+
public Status.Code getGrpcStatusCode() {
74+
return this.code;
75+
}
76+
7277
/**
7378
* Returns the error code represents by {@code name}, or {@code defaultValue} if {@code name} does
7479
* not map to a known code.

0 commit comments

Comments
 (0)