summaryrefslogtreecommitdiff
path: root/src/value.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-02-26 05:35:57 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-02-26 05:35:57 -0400
commitf09c3906a238c32c380bd7ec47fadf78ae7c8827 (patch)
tree4698914925d97207668a77d51dc2b1af9ccacaaa /src/value.cc
parent69e2c733b922666a16ffeb5879eee13b32dc7662 (diff)
downloadfork-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.cc7
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()) {