Made resource loading fail gracefully when a resource can't be loaded. Resources should now throw exceptions in their constuctor if the resource can't be loaded. This will result in ResourceManager::Load returning null.
This commit is contained in:
@@ -8,7 +8,7 @@ RawModel::RawModel(std::string fileName)
|
||||
if (scene == nullptr) {
|
||||
LOG_ERROR("Failed to load model \"%s\"", fileName.c_str());
|
||||
LOG_ERROR("Assimp error: %s", importer.GetErrorString());
|
||||
return;
|
||||
throw std::runtime_error("Failed to open model file.");
|
||||
}
|
||||
|
||||
auto m = scene->mRootNode->mTransformation;
|
||||
|
||||
Reference in New Issue
Block a user