diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2017-04-14T09·57+0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2017-04-14T09·57+0200 |
commit | 1673c373c9ddd1fc7ce1e12c79621dafe13fe930 (patch) | |
tree | 224bc2dba58410f2547941ba37113295cf80806a /src/nix-daemon/nix-daemon.cc | |
parent | 872ba75d8b6212c3a5e399ec62cbda86e58d3680 (diff) |
nix-daemon: Don't die if the user sends an unknown setting
Diffstat (limited to 'src/nix-daemon/nix-daemon.cc')
-rw-r--r-- | src/nix-daemon/nix-daemon.cc | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/nix-daemon/nix-daemon.cc b/src/nix-daemon/nix-daemon.cc index 9fcb81dd5aa3..b4e753f5521f 100644 --- a/src/nix-daemon/nix-daemon.cc +++ b/src/nix-daemon/nix-daemon.cc @@ -453,10 +453,14 @@ static void performOp(ref<LocalStore> store, bool trusted, unsigned int clientVe for (unsigned int i = 0; i < n; i++) { string name = readString(from); string value = readString(from); - if (name == "build-timeout") - settings.set(name, value); - else - settings.set(trusted ? name : "untrusted-" + name, value); + try { + if (name == "build-timeout") + settings.set(name, value); + else + settings.set(trusted ? name : "untrusted-" + name, value); + } catch (UsageError & e) { + warn(e.what()); + } } } startWork(); |