Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
import org.eclipse.microprofile.config.ConfigProvider;
import org.eclipse.microprofile.rest.client.RestClientBuilder;

import com.oracle.svm.core.jdk.UnsupportedFeatureError;

public class RestClientBase {

public static final String REST_URL_FORMAT = "%s/mp-rest/url";
Expand All @@ -45,8 +43,11 @@ public Object create() {
return builder.baseUrl(new URL(baseUrl)).build(proxyType);
} catch (MalformedURLException e) {
throw new IllegalArgumentException("The value of URL was invalid " + baseUrl);
} catch (UnsupportedFeatureError e) {
throw new IllegalArgumentException(baseUrl + " requires SSL support but it is disabled. You probably have set shamrock.ssl.native to false.");
} catch (Exception e) {
if ("com.oracle.svm.core.jdk.UnsupportedFeatureError".equals(e.getClass().getCanonicalName())) {
throw new IllegalArgumentException(baseUrl + " requires SSL support but it is disabled. You probably have set shamrock.ssl.native to false.");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. By the way, could you also fix it to not swallow the original exception and add it as a cause?

Thanks.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure thing, I will do that!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Although CI seemed to be failing for some reason (I did a build locally and everything was OK - I didn't try native however)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also ran the native test this time locally and everything seemed fine

}
throw e;
}
}

Expand Down