diff options
author | John Wiegley <johnw@newartisans.com> | 2009-02-26 05:35:57 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-02-26 05:35:57 -0400 |
commit | f09c3906a238c32c380bd7ec47fadf78ae7c8827 (patch) | |
tree | 4698914925d97207668a77d51dc2b1af9ccacaaa /src/value.cc | |
parent | 69e2c733b922666a16ffeb5879eee13b32dc7662 (diff) | |
download | fork-ledger-f09c3906a238c32c380bd7ec47fadf78ae7c8827.tar.gz fork-ledger-f09c3906a238c32c380bd7ec47fadf78ae7c8827.tar.bz2 fork-ledger-f09c3906a238c32c380bd7ec47fadf78ae7c8827.zip |
Print better error msg if evaluating mask as bool
Diffstat (limited to 'src/value.cc')
-rw-r--r-- | src/value.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/value.cc b/src/value.cc index 75d09441..755c18bb 100644 --- a/src/value.cc +++ b/src/value.cc @@ -93,6 +93,13 @@ value_t::operator bool() const return as_balance(); case STRING: return ! as_string().empty(); + case MASK: { + std::ostringstream out; + out << *this; + throw_(value_error, + _("Cannot determine truth of %1 (did you mean 'account =~ %2'?)") + << label() << out.str()); + } case SEQUENCE: if (! as_sequence().empty()) { foreach (const value_t& value, as_sequence()) { |