mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-07 15:36:20 -05:00
daemon: Gracefully handle cases where the daemon does not return a status code.
* guix/store.scm (process-stderr): Check for EOF before doing (read-int p).
This commit is contained in:
parent
6858f9d132
commit
0ff3e3aa9b
1 changed files with 4 additions and 1 deletions
|
@ -336,7 +336,10 @@ (define %stderr-error #x63787470)
|
|||
#f))
|
||||
((= k %stderr-error)
|
||||
(let ((error (read-latin1-string p))
|
||||
(status (if (>= (nix-server-minor-version server) 8)
|
||||
;; Currently the daemon fails to send a status code for early
|
||||
;; errors like DB schema version mismatches, so check for EOF.
|
||||
(status (if (and (>= (nix-server-minor-version server) 8)
|
||||
(not (eof-object? (lookahead-u8 p))))
|
||||
(read-int p)
|
||||
1)))
|
||||
(raise (condition (&nix-protocol-error
|
||||
|
|
Loading…
Reference in a new issue