Exporters: raise errors if output files cannot be opened.
This commit is contained in:
@@ -57,6 +57,10 @@ void ExportSceneSTL(const char* pFile,IOSystem* pIOSystem, const aiScene* pScene
|
||||
|
||||
// we're still here - export successfully completed. Write the file.
|
||||
boost::scoped_ptr<IOStream> outfile (pIOSystem->Open(pFile,"wt"));
|
||||
if(outfile == NULL) {
|
||||
throw DeadlyExportError("could not open output .stl file: " + std::string(pFile));
|
||||
}
|
||||
|
||||
outfile->Write( exporter.mOutput.str().c_str(), static_cast<size_t>(exporter.mOutput.tellp()),1);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user