From e41327350d5408eec3186cd3bbcbff94b5037640 Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Tue, 28 Jul 2020 18:14:08 +0200 Subject: http: Handle error on /download. * src/cuirass/http.scm (url-handler): Handle the error case on /download route. --- src/cuirass/http.scm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/cuirass/http.scm b/src/cuirass/http.scm index 36143b4..e7f0da7 100644 --- a/src/cuirass/http.scm +++ b/src/cuirass/http.scm @@ -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)) -- cgit v1.2.3