Skip to content

Commit

Permalink
doc(api): clarify code checking for errors
Browse files Browse the repository at this point in the history
  • Loading branch information
line-o committed Oct 5, 2023
1 parent 39a97ff commit e4c209e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/modules/api.xql
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,14 @@ declare function api:incremental($request as map(*)) as map(*) {
else (
let $write-lock := app:lock-write($config?path, "incremental")
let $incremental := $actions?incremental($config)
let $errors := some $a in ($incremental?new?*, $incremental?del?*)?2 satisfies not($a)

(:
Check if any of the previous additions or deletions did not succeed
Each action is an array with [path, success (, error)]
:)
let $results := ($incremental?new?*, $incremental?del?*)?2
let $errors := some $result in $results satisfies not($result)

let $remove-lock := app:lock-remove($config?path)

return
Expand Down

0 comments on commit e4c209e

Please sign in to comment.