Skip to content
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.

Hard to figure out when options are missing #313

Closed
damonfeldman opened this issue May 6, 2019 · 0 comments
Closed

Hard to figure out when options are missing #313

damonfeldman opened this issue May 6, 2019 · 0 comments
Milestone

Comments

@damonfeldman
Copy link

When options are missing or malformed (or in the wrong database) it would be helpful to say so explicitly. For debugging I've added this code into .../survivorship/merging/base.xqy at line 1844:

declare function merge-impl:get-options($options-name, $format as xs:string)
{
let $opt-uri := $MERGING-OPTIONS-DIR||$options-name||".xml"
let $options-doc := fn:doc($opt-uri)
let $options := $options-doc/merging:options
let $check :=
if (empty($options-doc)) then
(xdmp:log("no options doc:"||$opt-uri),
fn:error(xs:QName("SM-MISSING-CONFIG"), "no options doc found at URI '" || $opt-uri || "' in database: " || xdmp:database-name(xdmp:database()))
)
else if (empty($options)) then
(xdmp:log("no options node in options doc at "||$opt-uri),
fn:error(xs:QName("SM-MISSING-CONFIG"), "no merging:options node found at root of doc(" || $opt-uri || ") in database: " || xdmp:database-name(xdmp:database()))
)
else
(xdmp:log("no problem getting config"))

which does explicit checks and returns a (new) error code when options are missing or malformed, including the URI and DB being checked.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants