Changed the type being throw of some exceptions
This commit is contained in:
parent
ccfa8ce82c
commit
ab9fc6f9f0
1 changed files with 5 additions and 5 deletions
10
src/item.cc
10
src/item.cc
|
|
@ -212,23 +212,23 @@ namespace {
|
||||||
else if (args[0].is_mask())
|
else if (args[0].is_mask())
|
||||||
return item.has_tag(args[0].as_mask());
|
return item.has_tag(args[0].as_mask());
|
||||||
else
|
else
|
||||||
throw_(std::logic_error,
|
throw_(std::runtime_error,
|
||||||
_("Expected string for argument 1, but received %1")
|
_("Expected string or mask for argument 1, but received %1")
|
||||||
<< args[0].label());
|
<< args[0].label());
|
||||||
}
|
}
|
||||||
else if (args.size() == 2) {
|
else if (args.size() == 2) {
|
||||||
if (args[0].is_mask() && args[1].is_mask())
|
if (args[0].is_mask() && args[1].is_mask())
|
||||||
return item.has_tag(args[0].to_mask(), args[1].to_mask());
|
return item.has_tag(args[0].to_mask(), args[1].to_mask());
|
||||||
else
|
else
|
||||||
throw_(std::logic_error,
|
throw_(std::runtime_error,
|
||||||
_("Expected masks for arguments 1 and 2, but received %1 and %2")
|
_("Expected masks for arguments 1 and 2, but received %1 and %2")
|
||||||
<< args[0].label() << args[1].label());
|
<< args[0].label() << args[1].label());
|
||||||
}
|
}
|
||||||
else if (args.size() == 0) {
|
else if (args.size() == 0) {
|
||||||
throw_(std::logic_error, _("Too few arguments to function"));
|
throw_(std::runtime_error, _("Too few arguments to function"));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
throw_(std::logic_error, _("Too many arguments to function"));
|
throw_(std::runtime_error, _("Too many arguments to function"));
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue