use specialized exception classes

This commit is contained in:
wmayer
2017-04-28 18:49:11 +02:00
parent 998c000516
commit fb7094bf31
60 changed files with 675 additions and 349 deletions

View File

@@ -91,7 +91,7 @@ App::DocumentObjectExecReturn *SetOperations::execute(void)
else if (ot == "outer")
type = MeshCore::SetOperations::Outer;
else
throw new Base::Exception("Operation type must either be 'union' or 'intersection'"
throw new Base::ValueError("Operation type must either be 'union' or 'intersection'"
" or 'difference' or 'inner' or 'outer'");
MeshCore::SetOperations setOp(meshKernel1.getKernel(), meshKernel2.getKernel(),
@@ -102,9 +102,9 @@ App::DocumentObjectExecReturn *SetOperations::execute(void)
else {
// Error mesh property
if (!mesh1)
throw new Base::Exception("First input mesh not set");
throw new Base::ValueError("First input mesh not set");
if (!mesh2)
throw new Base::Exception("Second input mesh not set");
throw new Base::ValueError("Second input mesh not set");
}
return App::DocumentObject::StdReturn;