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 06:07:41 UTC

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

natechadwick 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_r376227845
 
 

 ##########
 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:
   I can do that, but the way that the code is currently implemented, the only caller is looking for a MalformedURLException if there is any problem in this method, and the request chain gets nuked if any other exception is thrown which is kinda catastrophic.  Was thinking that any exception from this method should raise the MalformedURLException so the caller just returns false. Future proofing.  If you still want the specific exception caught I can edit and resubmit. 

----------------------------------------------------------------
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