Throw Python exception if format is unknown.

This commit is contained in:
Ian Rees 2017-02-19 13:12:04 +13:00 committed by wmayer
parent 095bb48c22
commit 2231baa060

View File

@ -328,9 +328,14 @@ private:
App::Application::Config()["BuildRevisionHash"];
exporter.reset( new AmfExporter(outputFileName, meta, exportAmfCompressed) );
} else {
// TODO: How do we handle unknown exportFormats?
} else if (exportFormat != MeshIO::Undefined) {
exporter.reset( new MergeExporter(outputFileName, exportFormat) );
} else {
std::string exStr("Can't determine mesh format from file name: '");
exStr += outputFileName + "'";
throw Py::Exception(Base::BaseExceptionFreeCADError, exStr.c_str());
}
Py::Sequence list(objects);