Handle package versions not being found
This commit is contained in:
parent
571ed55c9f
commit
9a03cdff18
2 changed files with 33 additions and 22 deletions
|
|
@ -993,6 +993,12 @@
|
||||||
'(application/json text/html)
|
'(application/json text/html)
|
||||||
mime-types)
|
mime-types)
|
||||||
((application/json)
|
((application/json)
|
||||||
|
(if (null? metadata)
|
||||||
|
(render-json
|
||||||
|
`((name . ,name)
|
||||||
|
(version . ,version)
|
||||||
|
(error . "package not found"))
|
||||||
|
#:code 404)
|
||||||
(render-json
|
(render-json
|
||||||
`((name . ,name)
|
`((name . ,name)
|
||||||
(version . ,version)
|
(version . ,version)
|
||||||
|
|
@ -1014,7 +1020,7 @@
|
||||||
(derivation . ,file-name)
|
(derivation . ,file-name)
|
||||||
(outputs . ,(list->vector outputs)))))
|
(outputs . ,(list->vector outputs)))))
|
||||||
derivations))))
|
derivations))))
|
||||||
#:extra-headers http-headers-for-unchanging-content))
|
#:extra-headers http-headers-for-unchanging-content)))
|
||||||
(else
|
(else
|
||||||
(render-html
|
(render-html
|
||||||
#:sxml (view-revision-package-and-version commit-hash
|
#:sxml (view-revision-package-and-version commit-hash
|
||||||
|
|
@ -1030,6 +1036,9 @@
|
||||||
#:header-link header-link
|
#:header-link header-link
|
||||||
#:version-history-link
|
#:version-history-link
|
||||||
version-history-link)
|
version-history-link)
|
||||||
|
#:code (if (null? metadata)
|
||||||
|
404
|
||||||
|
200)
|
||||||
#:extra-headers http-headers-for-unchanging-content)))))
|
#:extra-headers http-headers-for-unchanging-content)))))
|
||||||
|
|
||||||
(define* (render-revision-package-derivations mime-types
|
(define* (render-revision-package-derivations mime-types
|
||||||
|
|
|
||||||
|
|
@ -243,6 +243,8 @@
|
||||||
(div
|
(div
|
||||||
(@ (class "col-sm-12"))
|
(@ (class "col-sm-12"))
|
||||||
,(match package-metadata
|
,(match package-metadata
|
||||||
|
(()
|
||||||
|
"Package not found at this version")
|
||||||
(((synopsis synopsis-locale description description-locale home-page file line column-number
|
(((synopsis synopsis-locale description description-locale home-page file line column-number
|
||||||
licenses))
|
licenses))
|
||||||
`(dl
|
`(dl
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue