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

@@ -1016,7 +1016,7 @@ void View3DInventorViewer::savePicture(int w, int h, const QColor& bg, QImage& i
if (bgColor.isValid())
renderer.setBackgroundColor(SbColor4f(bgColor.redF(), bgColor.greenF(), bgColor.blueF(), bgColor.alphaF()));
if (!renderer.render(root))
throw Base::Exception("Offscreen rendering failed");
throw Base::RuntimeError("Offscreen rendering failed");
renderer.writeToImage(img);
root->unref();
@@ -1027,7 +1027,7 @@ void View3DInventorViewer::savePicture(int w, int h, const QColor& bg, QImage& i
if (bgColor.isValid())
renderer.setBackgroundColor(SbColor(bgColor.redF(), bgColor.greenF(), bgColor.blueF()));
if (!renderer.render(root))
throw Base::Exception("Offscreen rendering failed");
throw Base::RuntimeError("Offscreen rendering failed");
renderer.writeToImage(img);
root->unref();
@@ -1211,14 +1211,14 @@ bool View3DInventorViewer::dumpToFile(SoNode* node, const char* filename, bool b
vo = std::unique_ptr<SoVectorizeAction>(new SoFCVectorizeU3DAction());
}
else {
throw Base::Exception("Not supported vector graphic");
throw Base::ValueError("Not supported vector graphic");
}
SoVectorOutput* out = vo->getOutput();
if (!out || !out->openFile(filename)) {
std::ostringstream a_out;
a_out << "Cannot open file '" << filename << "'";
throw Base::Exception(a_out.str());
throw Base::FileSystemError(a_out.str());
}
saveGraphic(ps,c,vo.get());