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

andy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/jena.git

commit 8830e1e401a54384c67a008b7b5232ae8c028a50
Author: Andy Seaborne <[email protected]>
AuthorDate: Thu Jul 3 12:43:56 2025 +0100

    GH-3293: Call error handler on bad text direction
---
 .../main/java/org/apache/jena/riot/system/ParserProfileStd.java    | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git 
a/jena-arq/src/main/java/org/apache/jena/riot/system/ParserProfileStd.java 
b/jena-arq/src/main/java/org/apache/jena/riot/system/ParserProfileStd.java
index 58eafbda9b..55696e9268 100644
--- a/jena-arq/src/main/java/org/apache/jena/riot/system/ParserProfileStd.java
+++ b/jena-arq/src/main/java/org/apache/jena/riot/system/ParserProfileStd.java
@@ -29,6 +29,7 @@ import org.apache.jena.irix.IRIxResolver;
 import org.apache.jena.irix.RelativeIRIException;
 import org.apache.jena.query.ARQ;
 import org.apache.jena.riot.RiotException;
+import org.apache.jena.riot.RiotParseException;
 import org.apache.jena.riot.tokens.Token;
 import org.apache.jena.riot.tokens.TokenType;
 import org.apache.jena.sparql.core.Quad;
@@ -226,8 +227,10 @@ public class ParserProfileStd implements ParserProfile {
 
     @Override
     public Node createLangDirLiteral(String lexical, String langTag, String 
direction, long line, long col) {
-        if ( ! TextDirection.isValid(direction) )
-            throw new RiotException("Invalid base direction: '"+direction+"'. 
Must be 'ltr' or 'rtl'");
+        if ( ! TextDirection.isValid(direction) ) {
+            errorHandler.error("Invalid base direction: '"+direction+"'. Must 
be 'ltr' or 'rtl'", line, col);
+            throw new RiotException("Bad base direction: "+direction);
+        }
         if ( checking )
             Checker.checkLiteral(lexical, langTag, direction, null, 
errorHandler, line, col);
         return factory.createLangDirLiteral(lexical, langTag, direction);

Reply via email to