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

@@ -64,20 +64,17 @@ BaseProcess::~BaseProcess()
// ------------------------------------------------------------------------------------------------
void BaseProcess::ExecuteOnScene( Importer* pImp)
{
ai_assert(NULL != pImp && NULL != pImp->pimpl->mScene);
ai_assert(NULL != pImp && NULL != pImp->pimpl->mScene)
// catch exceptions thrown inside the PostProcess-Step
try
{
Execute(pImp->pimpl->mScene);
} catch( ImportErrorException* exception)
{
// extract error description
pImp->pimpl->mErrorString = exception->GetErrorText();
DefaultLogger::get()->error(pImp->pimpl->mErrorString);
} catch( const std::exception& err ) {
delete exception;
// extract error description
pImp->pimpl->mErrorString = err.what();
DefaultLogger::get()->error(pImp->pimpl->mErrorString);
// and kill the partially imported data
delete pImp->pimpl->mScene;