Skip to content

Commit

Permalink
Update SPI Error Messages (#16619)
Browse files Browse the repository at this point in the history
* Updated HttpClientProviders error message

* Updated JsonSerializerProviders error message

* Update links to aka.ms links
  • Loading branch information
alzimmermsft authored Oct 23, 2020
1 parent 965b272 commit a564e07
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<HttpClientProvider> serviceLoader = ServiceLoader.load(HttpClientProvider.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a564e07

Please sign in to comment.