Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

Commit

Permalink
Pass error message when creating exception
Browse files Browse the repository at this point in the history
  • Loading branch information
chanseokoh committed Nov 12, 2021
1 parent fca3a67 commit 21f78ee
Showing 1 changed file with 3 additions and 5 deletions.
Expand Up @@ -43,8 +43,6 @@ public static ApiException createException(
return new CancelledException(cause, statusCode, retryable);
case NOT_FOUND:
return new NotFoundException(cause, statusCode, retryable);
case UNKNOWN:
return new UnknownException(cause, statusCode, retryable);
case INVALID_ARGUMENT:
return new InvalidArgumentException(cause, statusCode, retryable);
case DEADLINE_EXCEEDED:
Expand Down Expand Up @@ -72,6 +70,7 @@ public static ApiException createException(
case UNAUTHENTICATED:
return new UnauthenticatedException(cause, statusCode, retryable);

case UNKNOWN: // Fall through.
default:
return new UnknownException(cause, statusCode, retryable);
}
Expand All @@ -84,8 +83,6 @@ public static ApiException createException(
return new CancelledException(message, cause, statusCode, retryable);
case NOT_FOUND:
return new NotFoundException(message, cause, statusCode, retryable);
case UNKNOWN:
return new UnknownException(message, cause, statusCode, retryable);
case INVALID_ARGUMENT:
return new InvalidArgumentException(message, cause, statusCode, retryable);
case DEADLINE_EXCEEDED:
Expand Down Expand Up @@ -113,8 +110,9 @@ public static ApiException createException(
case UNAUTHENTICATED:
return new UnauthenticatedException(message, cause, statusCode, retryable);

case UNKNOWN: // Fall through.
default:
return new UnknownException(cause, statusCode, retryable);
return new UnknownException(message, cause, statusCode, retryable);
}
}
}

0 comments on commit 21f78ee

Please sign in to comment.