@@ -39,13 +39,13 @@ public enum Code {
3939 INTERNAL (false , "Server returned an error" , 500 ),
4040 UNKNOWN (false , "Unknown failure" , -1 );
4141
42- private final boolean isTransient ;
43- private final String defaultMessage ;
42+ private final boolean retriable ;
43+ private final String message ;
4444 private final int httpCode ;
4545
46- Code (boolean isTransient , String msg , int httpCode ) {
47- this .isTransient = isTransient ;
48- defaultMessage = msg ;
46+ Code (boolean retriable , String message , int httpCode ) {
47+ this .retriable = retriable ;
48+ this . message = message ;
4949 this .httpCode = httpCode ;
5050 }
5151
@@ -57,12 +57,12 @@ public Integer httpCode() {
5757 * Returns {@code true} if this exception is transient and the same request could be retried.
5858 * For any retry it is highly recommended to apply an exponential backoff.
5959 */
60- public boolean isTransient () {
61- return isTransient ;
60+ public boolean isRetriable () {
61+ return retriable ;
6262 }
6363
64- DatastoreServiceException translate (DatastoreException exception , String msg ) {
65- return new DatastoreServiceException (this , msg , exception );
64+ DatastoreServiceException translate (DatastoreException exception , String message ) {
65+ return new DatastoreServiceException (this , message , exception );
6666 }
6767 }
6868
@@ -77,13 +77,13 @@ DatastoreServiceException translate(DatastoreException exception, String msg) {
7777 HTTP_TO_CODE = ImmutableMap .copyOf (httpCodes );
7878 }
7979
80- public DatastoreServiceException (Code code , String msg , Exception cause ) {
81- super (MoreObjects .firstNonNull (msg , code .defaultMessage ), cause );
80+ public DatastoreServiceException (Code code , String message , Exception cause ) {
81+ super (MoreObjects .firstNonNull (message , code .message ), cause );
8282 this .code = code ;
8383 }
8484
85- public DatastoreServiceException (Code code , String msg ) {
86- this (code , msg , null );
85+ public DatastoreServiceException (Code code , String message ) {
86+ this (code , message , null );
8787 }
8888
8989 /**
@@ -131,12 +131,12 @@ static DatastoreServiceException translateAndThrow(DatastoreException exception)
131131
132132
133133 /**
134- * Throw a DatastoreServiceException with {@code FAILED_PRECONDITION} code and the {@code msg }
134+ * Throw a DatastoreServiceException with {@code FAILED_PRECONDITION} code and the {@code message }
135135 * in a nested exception.
136136 *
137137 * @throws DatastoreServiceException every time
138138 */
139- static DatastoreServiceException throwInvalidRequest (String msg , Object ... params ) {
140- throw new DatastoreServiceException (Code .FAILED_PRECONDITION , String .format (msg , params ));
139+ static DatastoreServiceException throwInvalidRequest (String massage , Object ... params ) {
140+ throw new DatastoreServiceException (Code .FAILED_PRECONDITION , String .format (massage , params ));
141141 }
142142}
0 commit comments