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

@@ -132,7 +132,7 @@ void Discreet3DSImporter::InternReadFile( const std::string& pFile,
// We should have at least one chunk
if (stream.GetRemainingSize() < 16) {
throw new ImportErrorException("3DS file is either empty or corrupt: " + pFile);
throw DeadlyImportError("3DS file is either empty or corrupt: " + pFile);
}
// Allocate our temporary 3DS representation
@@ -220,7 +220,7 @@ void Discreet3DSImporter::ReadChunk(Discreet3DS::Chunk* pcOut)
pcOut->Size = stream->GetI4();
if (pcOut->Size - sizeof(Discreet3DS::Chunk) > stream->GetRemainingSize())
throw new ImportErrorException("Chunk is too large");
throw DeadlyImportError("Chunk is too large");
if (pcOut->Size - sizeof(Discreet3DS::Chunk) > stream->GetRemainingSizeToLimit())
DefaultLogger::get()->error("3DS: Chunk overflow");