Browse Source

show error message when rocket fails to open a file

rdb 14 years ago
parent
commit
6795dd86b1
1 changed files with 8 additions and 2 deletions
  1. 8 2
      panda/src/rocket/rocketFileInterface.cxx

+ 8 - 2
panda/src/rocket/rocketFileInterface.cxx

@@ -37,9 +37,15 @@ Rocket::Core::FileHandle RocketFileInterface::
 Open(const Rocket::Core::String& path) {
 Open(const Rocket::Core::String& path) {
   rocket_cat.debug() << "Opening " << path.CString() << "\n";
   rocket_cat.debug() << "Opening " << path.CString() << "\n";
 
 
+  Filename fn = Filename::from_os_specific(path.CString());
+  void *ptr = (void*) _vfs->open_read_file(fn, true);
+
+  if (ptr == NULL) {
+    rocket_cat.error() << "Failed to open " << fn << "\n";
+  }
+
   // A FileHandle is actually just a void pointer
   // A FileHandle is actually just a void pointer
-  return (Rocket::Core::FileHandle)
-    _vfs->open_read_file(Filename::from_os_specific(path.CString()), true);
+  return (Rocket::Core::FileHandle) ptr;
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////