1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-04-06 13:10:33 +02:00

file-systems: Correctly report mount failure diagnostics.

Previously the message would be something like:

  shepherd[1]: could not mount partition efivarfs: ~A

* gnu/build/file-systems.scm (mount-file-system): On ‘system-error?’
destructure the arguments of C.

Change-Id: I4e84d8ce424dd1d07eae5e22389164479309bbfd
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Merges: #7463
This commit is contained in:
Ludovic Courtès
2026-03-25 15:59:28 +01:00
parent 4d758ddbd2
commit c8d3b54459

View File

@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2014-2018, 2020-2022 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2014-2018, 2020-2022, 2026 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2016, 2017 David Craven <david@craven.ch>
;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
;;; Copyright © 2019 Guillaume Le Vaillant <glv@posteo.net>
@@ -1455,9 +1455,14 @@ corresponds to the symbols listed in FLAGS."
(raise c)))
((system-error? c)
(format (current-error-port)
"could not mount partition ~a: ~a~%"
"could not mount partition '~a': ~a~%"
(file-system-device fs)
(exception-message c))
(string-trim-both
(call-with-output-string
(lambda (port)
(print-exception port #f
(exception-kind c)
(exception-args c))))))
(unless (file-system-mount-may-fail? fs)
(raise c))))
(let* ((type (file-system-type fs))