Handle the 404 case when viewing store items
This commit is contained in:
parent
6add08b109
commit
9c23451482
2 changed files with 15 additions and 1 deletions
|
|
@ -507,7 +507,11 @@
|
||||||
(let ((derivation (select-derivation-by-output-filename conn filename)))
|
(let ((derivation (select-derivation-by-output-filename conn filename)))
|
||||||
(match derivation
|
(match derivation
|
||||||
(()
|
(()
|
||||||
#f)
|
(render-html
|
||||||
|
#:sxml (general-not-found
|
||||||
|
"Store item not found"
|
||||||
|
"No derivation found producing this output")
|
||||||
|
#:code 404))
|
||||||
(derivations
|
(derivations
|
||||||
(render-html
|
(render-html
|
||||||
#:sxml (view-store-item filename
|
#:sxml (view-store-item filename
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@
|
||||||
#:use-module (texinfo html)
|
#:use-module (texinfo html)
|
||||||
#:use-module (json)
|
#:use-module (json)
|
||||||
#:export (index
|
#:export (index
|
||||||
|
general-not-found
|
||||||
unknown-revision
|
unknown-revision
|
||||||
view-statistics
|
view-statistics
|
||||||
view-revision-package-and-version
|
view-revision-package-and-version
|
||||||
|
|
@ -1389,6 +1390,15 @@
|
||||||
(take data 2))
|
(take data 2))
|
||||||
(vlist->list target-packages-vhash))))))))))))
|
(vlist->list target-packages-vhash))))))))))))
|
||||||
|
|
||||||
|
(define (general-not-found header-text body)
|
||||||
|
(layout
|
||||||
|
#:body
|
||||||
|
`(,(header)
|
||||||
|
(div
|
||||||
|
(@ (class "container"))
|
||||||
|
(h1 ,header-text)
|
||||||
|
(p ,body)))))
|
||||||
|
|
||||||
(define (unknown-revision commit-hash job)
|
(define (unknown-revision commit-hash job)
|
||||||
(layout
|
(layout
|
||||||
#:body
|
#:body
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue