Make XSD login more robust
authorMathieu Baudier <mbaudier@argeo.org>
Tue, 12 Mar 2024 15:51:28 +0000 (16:51 +0100)
committerMathieu Baudier <mbaudier@argeo.org>
Tue, 12 Mar 2024 15:51:28 +0000 (16:51 +0100)
org.argeo.cms/src/org/argeo/cms/acr/CmsContentNamespace.java

index fe334cb5b9d5430aa7c28fddc6e438b2c120cc65..02abd4cda2641d4ff2fcb2e3743f1061e787fd9b 100644 (file)
@@ -1,5 +1,7 @@
 package org.argeo.cms.acr;
 
+import static java.lang.System.Logger.Level.ERROR;
+
 import java.net.MalformedURLException;
 import java.net.URI;
 import java.net.URL;
@@ -58,9 +60,13 @@ public enum CmsContentNamespace implements ContentNamespace {
                                // FIXME workaround when in nested OSGi frameworks
                                resource = URI.create("platform:/plugin/org.argeo.cms" + RESOURCE_BASE + resourceFileName).toURL();
                        } catch (MalformedURLException e) {
-                               throw new IllegalArgumentException("Cannot convert " + resourceFileName + " to URL");
+                               resource = null;
+                               System.getLogger(CmsContentNamespace.class.getName()).log(ERROR,
+                                               "Cannot load " + resourceFileName + ": " + e.getMessage());
+                               // throw new IllegalArgumentException("Cannot convert " + resourceFileName + "
+                               // to URL");
                        }
-                       Objects.requireNonNull(resource);
+                       // Objects.requireNonNull(resource);
                }
                if (publicUrl != null)
                        try {