From 6f932b118a1eb567c9fd1292633da7de8e3f77c8 Mon Sep 17 00:00:00 2001 From: Juri Leino Date: Mon, 16 Oct 2023 20:27:36 +0200 Subject: [PATCH] [fix] handle IllegalStateException in file:list#2 fixes #5028 The Java code of DirectoryList can throw an IllegalStateException when a non-existent directory is supplied as its first argument. This exception class is now handled in file:list#2. --- .../main/java/org/exist/xquery/modules/file/DirectoryList.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/modules/file/src/main/java/org/exist/xquery/modules/file/DirectoryList.java b/extensions/modules/file/src/main/java/org/exist/xquery/modules/file/DirectoryList.java index df783fd186d..4037227f7a0 100644 --- a/extensions/modules/file/src/main/java/org/exist/xquery/modules/file/DirectoryList.java +++ b/extensions/modules/file/src/main/java/org/exist/xquery/modules/file/DirectoryList.java @@ -172,7 +172,7 @@ public Sequence eval(final Sequence[] args, final Sequence contextSequence) thro builder.endElement(); return (NodeValue) builder.getDocument().getDocumentElement(); - } catch (final IOException e) { + } catch (final IOException | IllegalStateException e) { throw new XPathException(this, e.getMessage()); } finally { context.popDocumentContext();