Revamp exception handling. ImportErrorException renamed to DeadlyImportError to avoid silent regressions. Exceptions now thrown by value, and caught by reference. Put guards in all C++ and C API functions to avoid unwanted exception propagation across module and language boundaries.
PLEASE TEST CAREFULLY IF THIS SHOULD CAUSE REGRESSIONS. git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@617 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
This commit is contained in:
@@ -162,7 +162,7 @@ void DXFImporter::InternReadFile( const std::string& pFile,
|
||||
|
||||
// Check whether we can read from the file
|
||||
if( file.get() == NULL) {
|
||||
throw new ImportErrorException( "Failed to open DXF file " + pFile + "");
|
||||
throw DeadlyImportError( "Failed to open DXF file " + pFile + "");
|
||||
}
|
||||
|
||||
// read the contents of the file in a buffer
|
||||
@@ -175,7 +175,7 @@ void DXFImporter::InternReadFile( const std::string& pFile,
|
||||
|
||||
// check whether this is a binaray DXF file - we can't read binary DXF files :-(
|
||||
if (!strncmp(AI_DXF_BINARY_IDENT,buffer,AI_DXF_BINARY_IDENT_LEN))
|
||||
throw new ImportErrorException("DXF: Binary files are not supported at the moment");
|
||||
throw DeadlyImportError("DXF: Binary files are not supported at the moment");
|
||||
|
||||
// now get all lines of the file
|
||||
while (GetNextToken()) {
|
||||
@@ -212,7 +212,7 @@ void DXFImporter::InternReadFile( const std::string& pFile,
|
||||
}
|
||||
|
||||
if (!pScene->mNumMeshes)
|
||||
throw new ImportErrorException("DXF: this file contains no 3d data");
|
||||
throw DeadlyImportError("DXF: this file contains no 3d data");
|
||||
|
||||
pScene->mMeshes = new aiMesh*[ pScene->mNumMeshes ];
|
||||
unsigned int m = 0;
|
||||
|
||||
Reference in New Issue
Block a user