Skip to content

Commit 96bb442

Browse files
authored
Merge pull request #3896 from stexandev/hotfix/3895-repo-get-resource-does-not-work-as-documented
2 parents 895a475 + 9cb8962 commit 96bb442

File tree

1 file changed

+4
-4
lines changed
  • extensions/modules/expathrepo/src/main/java/org/exist/xquery/modules/expathrepo

1 file changed

+4
-4
lines changed

extensions/modules/expathrepo/src/main/java/org/exist/xquery/modules/expathrepo/GetResource.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ public class GetResource extends BasicFunction {
5151
},
5252
new FunctionReturnSequenceType(Type.BASE64_BINARY, Cardinality.ZERO_OR_ONE,
5353
"<status result=\"ok\"/> if deployment was ok. Throws an error otherwise."));
54-
54+
5555
public GetResource(XQueryContext context) {
5656
super(context, signature);
5757
}
58-
58+
5959
@Override
6060
public Sequence eval(Sequence[] args, Sequence contextSequence)
6161
throws XPathException {
@@ -72,8 +72,8 @@ public Sequence eval(Sequence[] args, Sequence contextSequence)
7272
// FileSystemResolver already returns an input stream
7373
StreamSource source = (StreamSource) pkg.getResolver().resolveResource(path);
7474
return Base64BinaryDocument.getInstance(context, source.getInputStream());
75-
} catch (Storage.NotExistException ex) {
76-
// nothing
75+
} catch (Storage.NotExistException e) {
76+
throw new XPathException(ErrorCodes.FODC0002, "Resource " + path + " does not exist.", e);
7777
}
7878
}
7979
}

0 commit comments

Comments
 (0)