You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by GitBox <gi...@apache.org> on 2020/02/07 03:22:52 UTC

[GitHub] [cxf] reta commented on a change in pull request #637: Cxf 8208 - Handle exceptions when looking up swagger ui resources

reta commented on a change in pull request #637: Cxf 8208 - Handle exceptions when looking up swagger ui resources
URL: https://github.com/apache/cxf/pull/637#discussion_r376197865
 
 

 ##########
 File path: rt/rs/description-swagger-ui/src/main/java/org/apache/cxf/jaxrs/swagger/ui/SwaggerUiResourceLocator.java
 ##########
 @@ -50,8 +50,14 @@ public URL locate(String resourcePath) throws MalformedURLException {
         if (resourcePath.startsWith("/")) {
             resourcePath = resourcePath.substring(1);
         }
+        URL ret;
 
-        return URI.create(swaggerUiRoot + resourcePath).toURL();
+        try {
+            ret = URI.create(swaggerUiRoot + resourcePath).toURL();
+        } catch (Exception ex) {
 
 Review comment:
   The `URI.create` may thrown only `IllegalArgumentException` exception, could you please use it instead of generic `Exception`? Thank you.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services