[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#27704] [PATCH] daemon: Show actual rather than collateral error whe

From: Jan Nieuwenhuizen
Subject: [bug#27704] [PATCH] daemon: Show actual rather than collateral error when export fails.
Date: Sat, 15 Jul 2017 12:58:51 +0200

Having the wrong permissions on /etc/guix/signing-key.sec gives

    guix-daemon: nix/libutil/ virtual 
nix::BufferedSink::~BufferedSink(): Assertion `!bufPos' failed.

this patch changes that to

    guix-daemon: error: file `/etc/guix/signing-key.sec' should be secret 
(inaccessible to everybody else)!

* nix/nix-daemon/ (performOp): Catch any exportPath exception,
report and exit on that.  Fixes failing later with uninformative collateral 
 nix/nix-daemon/ | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/nix/nix-daemon/ b/nix/nix-daemon/
index 7d26b6135..aeeadf144 100644
--- a/nix/nix-daemon/
+++ b/nix/nix-daemon/
@@ -436,7 +436,13 @@ static void performOp(bool trusted, unsigned int 
         bool sign = readInt(from) == 1;
         TunnelSink sink(to);
-        store->exportPath(path, sign, sink);
+        try {
+            store->exportPath(path, sign, sink);
+        }
+        catch (std::exception &e) {
+            fprintf (stderr, "guix-daemon: error: %s\n", e.what ());
+            exit (EXIT_FAILURE);
+        }
         writeInt(1, to);
Jan Nieuwenhuizen <address@hidden> | GNU LilyPond
Freelance IT | Avatar®

reply via email to

[Prev in Thread] Current Thread [Next in Thread]