mirror of
https://github.com/Z3Prover/z3
synced 2025-04-23 17:15:31 +00:00
improve error handling of parameters and remove work notes from udoc_relation
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
06c7f3f246
commit
00555def4d
3 changed files with 16 additions and 38 deletions
|
@ -302,10 +302,19 @@ public:
|
|||
svector<params::entry>::const_iterator end = m_entries.end();
|
||||
for (; it != end; ++it) {
|
||||
param_kind expected = p.get_kind(it->first);
|
||||
if (expected == CPK_INVALID)
|
||||
throw default_exception("unknown parameter '%s'", it->first.str().c_str());
|
||||
if (it->second.m_kind != expected)
|
||||
throw default_exception("parameter kind mismatch '%s'", it->first.str().c_str());
|
||||
if (expected == CPK_INVALID) {
|
||||
std::stringstream strm;
|
||||
strm << "unknown parameter '" << it->first.str() << "'\n";
|
||||
strm << "Legal parameters are:\n";
|
||||
p.display(strm, 2, false, false);
|
||||
throw default_exception(strm.str());
|
||||
}
|
||||
if (it->second.m_kind != expected) {
|
||||
std::stringstream strm;
|
||||
strm << "Parameter " << it->first.str() << " was given argument of type ";
|
||||
strm << it->second.m_kind << ", expected " << expected;
|
||||
throw default_exception(strm.str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue