This is an automated email from the ASF dual-hosted git repository.

joerghoh pushed a commit to branch SLING-13171-2
in repository 
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-i18n.git


The following commit(s) were added to refs/heads/SLING-13171-2 by this push:
     new 152dadf  SLING-13171 improve error handling
152dadf is described below

commit 152dadf8429a03ebd3e02c71d5a58a862162812b
Author: Joerg Hoh <[email protected]>
AuthorDate: Sun Apr 26 11:37:49 2026 +0200

    SLING-13171 improve error handling
---
 src/main/java/org/apache/sling/i18n/impl/JcrResourceBundle.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/apache/sling/i18n/impl/JcrResourceBundle.java 
b/src/main/java/org/apache/sling/i18n/impl/JcrResourceBundle.java
index 49bab45..559e37d 100644
--- a/src/main/java/org/apache/sling/i18n/impl/JcrResourceBundle.java
+++ b/src/main/java/org/apache/sling/i18n/impl/JcrResourceBundle.java
@@ -21,6 +21,7 @@ package org.apache.sling.i18n.impl;
 import javax.json.spi.JsonProvider;
 import javax.json.stream.JsonParser;
 import javax.json.stream.JsonParser.Event;
+import javax.json.stream.JsonParsingException;
 
 import java.io.IOException;
 import java.io.InputStream;
@@ -255,7 +256,7 @@ public class JcrResourceBundle extends ResourceBundle {
             try (InputStream input = stream) {
                 Charset charset = StandardCharsets.UTF_8;
                 final ResourceMetadata metadata = 
resource.getResourceMetadata();
-                if (metadata != null && metadata.getCharacterEncoding() != 
null) {
+                if (metadata.getCharacterEncoding() != null) {
                     charset = Charset.forName(metadata.getCharacterEncoding());
                 }
 
@@ -271,7 +272,7 @@ public class JcrResourceBundle extends ResourceBundle {
                         }
                     }
                 }
-            } catch (IOException | RuntimeException e) {
+            } catch (IOException | IllegalArgumentException | 
JsonParsingException e) {
                 log.warn("Could not parse i18n json dictionary {}: {}", 
resource.getPath(), e.getMessage());
             }
         } else {

Reply via email to