Print better error msg if evaluating mask as bool
This commit is contained in:
parent
69e2c733b9
commit
f09c3906a2
1 changed files with 7 additions and 0 deletions
|
|
@ -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()) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue