Render a branch not found page if the branch doesn't exist

This commit is contained in:
Christopher Baines 2022-11-19 10:07:17 +00:00
parent 91f0fbdeb5
commit e87a8124bf

View file

@ -147,15 +147,21 @@
(data_available . ,data-available?))))
revisions))))))
(else
(render-html
#:sxml (if (any-invalid-query-parameters? parsed-query-parameters)
(view-branch repository-id
branch-name parsed-query-parameters '())
(view-branch
repository-id
branch-name
parsed-query-parameters
revisions))))))))
(if (null? revisions)
(render-html
#:sxml (general-not-found
"Branch not found"
"")
#:code 404)
(render-html
#:sxml (if (any-invalid-query-parameters? parsed-query-parameters)
(view-branch repository-id
branch-name parsed-query-parameters '())
(view-branch
repository-id
branch-name
parsed-query-parameters
revisions)))))))))
(('GET "repository" repository-id "branch" branch-name "package" package-name)
(letpar& ((package-versions
(with-thread-postgresql-connection