- updated error handling to be more flexible so we can display better error details (like bad tga file, etc)

This commit is contained in:
Mark Vejvoda
2012-11-10 23:19:42 +00:00
parent 56e4843d13
commit 8ba5524f35
12 changed files with 377 additions and 258 deletions

View File

@@ -1279,8 +1279,15 @@ void Model::loadG3d(const string &path, bool deletePixMapAfterLoad,
}
fclose(f);
}
catch(megaglest_runtime_error& ex) {
//printf("1111111 ex.wantStackTrace() = %d\n",ex.wantStackTrace());
SystemFlags::OutputDebug(SystemFlags::debugError,"In [%s::%s Line: %d] Error [%s]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,ex.what());
//printf("2222222\n");
throw megaglest_runtime_error("Exception caught loading 3d file: " + path +"\n"+ ex.what(),!ex.wantStackTrace());
}
catch(exception &e){
//abort();
SystemFlags::OutputDebug(SystemFlags::debugError,"In [%s::%s Line: %d] Error [%s]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,e.what());
throw megaglest_runtime_error("Exception caught loading 3d file: " + path +"\n"+ e.what());
}