From a564e075dcc48886478afc34be284c3031d30968 Mon Sep 17 00:00:00 2001 From: Alan Zimmer <48699787+alzimmermsft@users.noreply.github.com> Date: Fri, 23 Oct 2020 08:58:08 -0700 Subject: [PATCH] Update SPI Error Messages (#16619) * Updated HttpClientProviders error message * Updated JsonSerializerProviders error message * Update links to aka.ms links --- .../core/implementation/http/HttpClientProviders.java | 7 +++++-- .../core/util/serializer/JsonSerializerProviders.java | 8 ++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/sdk/core/azure-core/src/main/java/com/azure/core/implementation/http/HttpClientProviders.java b/sdk/core/azure-core/src/main/java/com/azure/core/implementation/http/HttpClientProviders.java index 96b3d24120c85..fe826da4c305b 100644 --- a/sdk/core/azure-core/src/main/java/com/azure/core/implementation/http/HttpClientProviders.java +++ b/sdk/core/azure-core/src/main/java/com/azure/core/implementation/http/HttpClientProviders.java @@ -13,8 +13,11 @@ */ public final class HttpClientProviders { private static HttpClientProvider defaultProvider; - private static final String CANNOT_FIND_HTTP_CLIENT = - "Cannot find any HttpClient provider on the classpath - unable to create a default HttpClient instance"; + private static final String CANNOT_FIND_HTTP_CLIENT = "A request was made to load the default HttpClient provider " + + "but one could not be found on the classpath. If you are using a dependency manager, consider including a " + + "dependency on azure-core-http-netty or azure-core-http-okhttp. Depending on your existing dependencies, you " + + "have the choice of Netty or OkHttp implementations. Additionally, refer to " + + "https://aka.ms/azsdk/java/docs/custom-httpclient to learn about writing your own implementation."; static { ServiceLoader serviceLoader = ServiceLoader.load(HttpClientProvider.class); diff --git a/sdk/core/azure-core/src/main/java/com/azure/core/util/serializer/JsonSerializerProviders.java b/sdk/core/azure-core/src/main/java/com/azure/core/util/serializer/JsonSerializerProviders.java index f080043d77990..82131dd5b04a9 100644 --- a/sdk/core/azure-core/src/main/java/com/azure/core/util/serializer/JsonSerializerProviders.java +++ b/sdk/core/azure-core/src/main/java/com/azure/core/util/serializer/JsonSerializerProviders.java @@ -10,8 +10,12 @@ * This class is a proxy for using a {@link JsonSerializerProvider} loaded from the classpath. */ public final class JsonSerializerProviders { - private static final String CANNOT_FIND_JSON_SERIALIZER_PROVIDER = - "Cannot find any JSON serializer provider on the classpath."; + private static final String CANNOT_FIND_JSON_SERIALIZER_PROVIDER = "A request was made to load the default JSON " + + "serializer provider but one could not be found on the classpath. If you are using a dependency manager, " + + "consider including a dependency on azure-core-serializer-json-jackson or azure-core-serializer-json-gson. " + + "Depending on your existing dependencies, you have the choice of Jackson or GSON implementations. " + + "Additionally, refer to https://aka.ms/azsdk/java/docs/custom-jsonserializer to learn about writing your own " + + "implementation."; private static JsonSerializerProvider defaultProvider; private static boolean attemptedLoad;