diff options
author | Chuck <chuck@intelligence.org> | 2019-09-06 11:38:29 -0700 |
---|---|---|
committer | Linus Heckemann <git@sphalerite.org> | 2019-11-04 15:11:45 +0100 |
commit | 0adf77e2eeb5227666f54ac6476884f9ddb63bee (patch) | |
tree | 1ceb94335e5fd788badf3758e54e760c8873ba15 /nixos | |
parent | c7c684aaa3e165287be4b9d8345481e1d85c04e8 (diff) | |
download | nixpkgs-0adf77e2eeb5227666f54ac6476884f9ddb63bee.tar nixpkgs-0adf77e2eeb5227666f54ac6476884f9ddb63bee.tar.gz nixpkgs-0adf77e2eeb5227666f54ac6476884f9ddb63bee.tar.bz2 nixpkgs-0adf77e2eeb5227666f54ac6476884f9ddb63bee.tar.lz nixpkgs-0adf77e2eeb5227666f54ac6476884f9ddb63bee.tar.xz nixpkgs-0adf77e2eeb5227666f54ac6476884f9ddb63bee.tar.zst nixpkgs-0adf77e2eeb5227666f54ac6476884f9ddb63bee.zip |
Narrow the «not defined» check to just ThrownError
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/installer/tools/nixos-option/nixos-option.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/nixos/modules/installer/tools/nixos-option/nixos-option.cc b/nixos/modules/installer/tools/nixos-option/nixos-option.cc index 5886ee6959b..1fde8986fdf 100644 --- a/nixos/modules/installer/tools/nixos-option/nixos-option.cc +++ b/nixos/modules/installer/tools/nixos-option/nixos-option.cc @@ -352,7 +352,7 @@ void printValue(Context * ctx, Out & out, std::variant<Value, std::exception_ptr ctx->state->forceValueDeep(v); out << v; } - } catch (Error & e) { + } catch (ThrownError & e) { if (e.msg() == "The option `" + path + "' is used but not defined.") { // 93% of errors are this, and just letting this message through would be // misleading. These values may or may not actually be "used" in the @@ -365,6 +365,8 @@ void printValue(Context * ctx, Out & out, std::variant<Value, std::exception_ptr } else { out << describeError(e); } + } catch (Error & e) { + out << describeError(e); } } |