http: Really gracefully handle missing file on /download.
This is a followup to 103a6ec27b
.
* src/cuirass/http.scm (url-handler): Remove ‘catch 'system-error’ for
“/download” handler since ‘respond-file’ cannot possibly throw to
'system-error. Add explicit ‘file-exists?’ call instead.
This commit is contained in:
parent
db6b633711
commit
93e27ff07c
|
@ -1247,13 +1247,9 @@ passed, only display JOBS targeting this SYSTEM."
|
|||
(respond-json-with-error
|
||||
code "Could not find the requested build product."))))
|
||||
(if file
|
||||
(catch 'system-error
|
||||
(lambda ()
|
||||
(respond-file file #:ttl %static-file-ttl))
|
||||
(lambda args
|
||||
(if (= ENOENT (system-error-errno args))
|
||||
(fail 500) ;something's wrong: it vanished
|
||||
(apply throw args))))
|
||||
(if (file-exists? file)
|
||||
(respond-file file #:ttl %static-file-ttl)
|
||||
(fail 500)) ;something's wrong: it vanished
|
||||
(fail 404)))) ;no such build product
|
||||
|
||||
(('GET "machine" name)
|
||||
|
|
Loading…
Reference in New Issue