From 9faa293388b971a13a8a7a64eb129c048157a9fb Mon Sep 17 00:00:00 2001 From: Martin Middel Date: Wed, 21 Aug 2024 17:02:32 +0200 Subject: [PATCH] fix(router): Handle errors without description Can occur when deploying apps. There is a value though! this is caused by a bug on exist-db: https://github.com/eXist-db/exist/issues/4686 --- content/router.xql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/router.xql b/content/router.xql index e278794..ed08f75 100644 --- a/content/router.xql +++ b/content/router.xql @@ -360,11 +360,11 @@ declare %private function router:resolve-ref ($config as map(*), $parts as xs:st : Add line and source info to error description. To avoid outputting multiple locations : for rethrown errors, check if $value is set. :) -declare %private function router:error-description ($description as xs:string, $line as xs:integer?, $column as xs:integer?, $module as xs:string?, $value as item()*) as xs:string { +declare %private function router:error-description ($description as xs:string?, $line as xs:integer?, $column as xs:integer?, $module as xs:string?, $value as item()*) as xs:string { if ($line and $line > 0 and empty($value)) then ``[`{$description}` [at line `{$line}` column `{$column}` in module `{head(($module, 'unknown'))}`]]`` else - $description + ($description, $value)[1] }; (:~