Skip to content

Commit

Permalink
OgreZip: throw on error to be consistent with FileSystemArchive
Browse files Browse the repository at this point in the history
  • Loading branch information
paroj committed Feb 3, 2017
1 parent 1376971 commit 5f8f47e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions OgreMain/src/OgreZip.cpp
Expand Up @@ -69,6 +69,9 @@ namespace Ogre {
case ZZIP_DIR_EDH_MISSING:
errorMsg = "Zip-file's central directory record missing. Is this a 7z file?";
break;
case ZZIP_ENOENT:
errorMsg = "File not in archive.";
break;
default:
errorMsg = "Unknown error.";
break;
Expand Down Expand Up @@ -172,11 +175,10 @@ namespace Ogre {
{
int zerr = zzip_error(mZzipDir);
String zzDesc = getZzipErrorDescription((zzip_error_t)zerr);
LogManager::getSingleton().logMessage(
mName + " - Unable to open file " + lookUpFileName + ", error was '" + zzDesc + "'", LML_CRITICAL);

// return null pointer
return DataStreamPtr();

OGRE_EXCEPT(Exception::ERR_FILE_NOT_FOUND,
mName+ " Cannot open file: " + filename + " - "+zzDesc,
"FileSystemArchive::open");
}

// Get uncompressed size too
Expand Down

0 comments on commit 5f8f47e

Please sign in to comment.