Gently fail Edirom Online if no Edition is available in database
If no edition is installed in the database the Edirom Online fails ungently with:
<exception>
<path>/db/apps/Edirom-Online/index.xql</path>
<message>err:FODC0005 exerr:ERROR Error. [at line 95, column 5] In function: edition:getPreferencesURI(xs:string) [9:38:/db/apps/Edirom-Online/data/xqm/edition.xqm]</message>
</exception>
This should be caught and a statement, e.g., "no edition available in the database", should be printed.
The current design of index.xql always assumes that there is at least one Edirom Edition installed in the database. Consequently, index.xql will always produce an error when trying to fetch the name of that single edition via preferences, as no preferences can be found…
This logic probably should be handled via eXist-db controller.xql and forward to different templates depending on:
- whether an edition ID was submitted in the request
- if multiple editions were found in the database
- if a single edition was found
- if no edition was found
@riedde created a landing page for multiple editions in 5c54b4727f44e32b44c06e8238ab59e28ff0721d.
So I assume only 1. and 4. still need to be implemented, right?
Yes, I'm not sure, if 1. is already possible. I know that @nikobeer is into this. Concerning 4, I see two was: Creating an "error-page" for this case or including the edition-example repo as a submodule so the edirom is never empty. For the last one we would need a technique (e.g., an option) to deactivate this example if not needed. Just an idea, but I think an error handler would be most sufficent.
implemented by #429, hence closing here