Skip to content
Permalink
Browse files
feat: add public method to get gRPC status code (#25)
Fixes #14.
  • Loading branch information
olavloite committed Jan 10, 2020
1 parent 93c0aed commit 2dbe3cf397357de09d24bb57e367bbe947e682f4
Showing with 5 additions and 0 deletions.
  1. +5 −0 google-cloud-spanner/src/main/java/com/google/cloud/spanner/ErrorCode.java
@@ -69,6 +69,11 @@ Status getGrpcStatus() {
return this.code.toStatus();
}

/** @return the corresponding gRPC status code of this {@link ErrorCode}. */
public Status.Code getGrpcStatusCode() {
return this.code;
}

/**
* Returns the error code represents by {@code name}, or {@code defaultValue} if {@code name} does
* not map to a known code.

0 comments on commit 2dbe3cf

Please sign in to comment.