浏览代码

More exceptions

Eiyeron Fulmincendii 10 年之前
父节点
当前提交
b7178ffb67
共有 1 个文件被更改,包括 1 次插入2 次删除
  1. 1 2
      src/piaf/Archive.cpp

+ 1 - 2
src/piaf/Archive.cpp

@@ -248,7 +248,7 @@ File Archive::get(const char *filename)
                 if (fread(data, sizeof(uint8_t), entries[index].file_size, file) !=
                 if (fread(data, sizeof(uint8_t), entries[index].file_size, file) !=
                     entries[index].file_size)
                     entries[index].file_size)
                 {
                 {
-                    // throw loading error
+                    throw PIAF::PIAFException("%s: couldn't load %s from an archive.", filename);
                 }
                 }
                 else
                 else
                 {
                 {
@@ -264,7 +264,6 @@ File Archive::get(const char *filename)
         }
         }
     }
     }
     return File();
     return File();
-    // throw not found exception
 }
 }
 
 
 File::File(uint8_t *data) : data(data)
 File::File(uint8_t *data) : data(data)