Skip to content

Commit 55dbb6c

Browse files
author
Nico Verwer
committed
fix for #5028
The Java code of DirectoryList throws an IllegalStateException when a non-existent directory is supplied as its first argument, which is an unchecked exception and therefore not caught in Java.
1 parent e6cd0a3 commit 55dbb6c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

extensions/modules/file/src/main/java/org/exist/xquery/modules/file/DirectoryList.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,8 @@ public Sequence eval(final Sequence[] args, final Sequence contextSequence) thro
172172
builder.endElement();
173173

174174
return (NodeValue) builder.getDocument().getDocumentElement();
175+
} catch (final IllegalStateException e) {
176+
throw new XPathException(this, e.getMessage());
175177
} catch (final IOException e) {
176178
throw new XPathException(this, e.getMessage());
177179
} finally {

0 commit comments

Comments
 (0)