Handle package versions not being found

This commit is contained in:
Christopher Baines 2025-11-13 12:45:50 +00:00
parent 571ed55c9f
commit 9a03cdff18
2 changed files with 33 additions and 22 deletions

View file

@ -993,6 +993,12 @@
'(application/json text/html)
mime-types)
((application/json)
(if (null? metadata)
(render-json
`((name . ,name)
(version . ,version)
(error . "package not found"))
#:code 404)
(render-json
`((name . ,name)
(version . ,version)
@ -1014,7 +1020,7 @@
(derivation . ,file-name)
(outputs . ,(list->vector outputs)))))
derivations))))
#:extra-headers http-headers-for-unchanging-content))
#:extra-headers http-headers-for-unchanging-content)))
(else
(render-html
#:sxml (view-revision-package-and-version commit-hash
@ -1030,6 +1036,9 @@
#:header-link header-link
#:version-history-link
version-history-link)
#:code (if (null? metadata)
404
200)
#:extra-headers http-headers-for-unchanging-content)))))
(define* (render-revision-package-derivations mime-types

View file

@ -243,6 +243,8 @@
(div
(@ (class "col-sm-12"))
,(match package-metadata
(()
"Package not found at this version")
(((synopsis synopsis-locale description description-locale home-page file line column-number
licenses))
`(dl