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:
[email protected]


With regards,
Apache Git Services

Reply via email to