-
-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Cannot differentiate installation issues by error code #4686
Comments
The repo module declares |
BaseX' implementation distinguishes between the errors (see https://docs.basex.org/wiki/Repository_Module#Errors)
|
Since Version 9.0 BaseX bound all errors to the repo module.
I like this change as it makes it easier for XQuery modules calling repo functions to catch errors that might occur. In eXist we currently have to declare a separate namespace declare namespace repo="http://exist-db.org/xquery/repo";
declare namespace experr="http://expath.org/ns/error";
try {
repo:undeploy('my/app')
}
catch experr:* {
(: handle the error :)
} |
The approach BaseX has taken makes a lot of sense. |
What is the namespace for that module in BaseX? |
It's a BaseX-specific module:
|
So I think there are two things separate things to think about here, one which I think is a good idea, and one which I think needs a little thought...
|
The XPath spec does not mention any error codes as I wrote. |
I am pleased to read that we agree on the two main points. Change the implementation to throw specific errors and put them in the namespace of the repo module. |
The first step now is to introduce the new error codes in the repo module and throw them for specific error classes, even if we have to resort to parse the message of a thrown PackageException. |
Next step:
|
Can occur when deploying apps. There is a value though! this is caused by a bug on exist-db: eXist-db/exist#4686
Describe the bug
If an error is encountered running
repo:install-and-deploy-from-db('/db/path/to/my.xar', 'https://my-repo/find')
will always throw an error with
experr:EXPATH00
.When caught its
$err:description
will always be empty.This code is defined in
org.exist.xquery.modules.expathrepo.EXPathErrorCode
asOn top of that the error codes do not follow the schema defined in the same class.
EXPATH specific errors
Stated:
EXP(DY|SE|ST)[0-9]{4}
Actual:
EXPATH[0-9]{2,3}
Sadly, the error codes do not seem to be defined by the EXPath pkg specification.
Does that actually mean we are free to use whatever codes we like?
Expected behavior
I would expect that specific error codes are used depending on the problem that was encountered.
These codes are defined in the class and also used in other repo-module implementation code.
To Reproduce
Just to highlight one of the many problems below is a XQSuite test that tries to install a package from a db-local XAR that is non-existent.
Context (please always complete the following information):
Build: eXist-6.1.0-SNAPSHOT (${build-commit})
Java: 1.8.0_352 (Azul Systems, Inc.)
OS: Mac OS X 12.6.2 (aarch64)
Additional context
conf.xml
? noneThe text was updated successfully, but these errors were encountered: