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:
aramis_acg
2010-03-18 17:00:12 +00:00
parent 79c14ce896
commit 762a7df46a
61 changed files with 565 additions and 354 deletions

View File

@@ -471,7 +471,7 @@ void LWSImporter::InternReadFile( const std::string& pFile, aiScene* pScene,
// Check whether we can read from the file
if( file.get() == NULL) {
throw new ImportErrorException( "Failed to open LWS file " + pFile + ".");
throw DeadlyImportError( "Failed to open LWS file " + pFile + ".");
}
// Allocate storage and copy the contents of the file to a memory buffer
@@ -500,7 +500,7 @@ void LWSImporter::InternReadFile( const std::string& pFile, aiScene* pScene,
motion_file = true;
if ((*it).tokens[0] != "LWSC" && !motion_file)
throw new ImportErrorException("LWS: Not a LightWave scene, magic tag LWSC not found");
throw DeadlyImportError("LWS: Not a LightWave scene, magic tag LWSC not found");
// get file format version and print to log
++it;
@@ -808,7 +808,7 @@ void LWSImporter::InternReadFile( const std::string& pFile, aiScene* pScene,
++ no_parent;
}
if (!no_parent)
throw new ImportErrorException("LWS: Unable to find scene root node");
throw DeadlyImportError("LWS: Unable to find scene root node");
// Load all subsequent files