http: Handle error on /download.

* src/cuirass/http.scm (url-handler): Handle the error case on /download
route.
This commit is contained in:
Mathieu Othacehe 2020-07-28 18:14:08 +02:00
parent f71f026a41
commit e41327350d
No known key found for this signature in database
GPG Key ID: 8354763531769CA6
1 changed files with 5 additions and 1 deletions

View File

@ -581,7 +581,11 @@ Hydra format."
(('GET "download" id)
(let ((path (db-get-build-product-path id)))
(respond-file path)))
(if path
(respond-file path)
(respond-json-with-error
500
"Could not find the request build product."))))
(('GET "static" path ...)
(respond-static-file path))