Edirom-Online icon indicating copy to clipboard operation
Edirom-Online copied to clipboard

Gently fail Edirom Online if no Edition is available in database

Open bwbohl opened this issue 2 years ago • 3 comments

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.

bwbohl avatar Jun 02 '23 07:06 bwbohl

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:

  1. whether an edition ID was submitted in the request
  2. if multiple editions were found in the database
  3. if a single edition was found
  4. if no edition was found

bwbohl avatar Apr 08 '24 06:04 bwbohl

@riedde created a landing page for multiple editions in 5c54b4727f44e32b44c06e8238ab59e28ff0721d.

So I assume only 1. and 4. still need to be implemented, right?

peterstadler avatar Sep 13 '24 18:09 peterstadler

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.

riedde avatar Sep 14 '24 10:09 riedde

implemented by #429, hence closing here

peterstadler avatar Oct 10 '24 21:10 peterstadler