Skip to content

Commit 871901c

Browse files
committed
use concrete exception
1 parent dbbdc43 commit 871901c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

google-http-client-apache-v5/src/main/java/com/google/api/client/http/apache/v5/Apache5HttpRequest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import com.google.api.client.http.LowLevelHttpResponse;
1919
import java.io.IOException;
2020
import java.util.concurrent.TimeUnit;
21+
import org.apache.hc.client5.http.ClientProtocolException;
2122
import org.apache.hc.client5.http.classic.HttpClient;
2223
import org.apache.hc.client5.http.classic.methods.HttpUriRequestBase;
2324
import org.apache.hc.client5.http.config.RequestConfig;
@@ -69,7 +70,7 @@ public LowLevelHttpResponse execute() throws IOException {
6970
try {
7071
target = RoutingSupport.determineHost(request);
7172
} catch (HttpException e) {
72-
throw new RuntimeException("The request's host is invalid.", e);
73+
throw new ClientProtocolException("The request's host is invalid.", e);
7374
}
7475
// we use a null context so the client creates the default one internally
7576
ClassicHttpResponse httpResponse = httpClient.executeOpen(target, request, null);

0 commit comments

Comments
 (0)