From 6795dd86b1cac11af6e9cb334933c3cf19401914 Mon Sep 17 00:00:00 2001 From: rdb Date: Sat, 11 Feb 2012 11:36:57 +0000 Subject: [PATCH] show error message when rocket fails to open a file --- panda/src/rocket/rocketFileInterface.cxx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/panda/src/rocket/rocketFileInterface.cxx b/panda/src/rocket/rocketFileInterface.cxx index 315c34610f..30ef03899f 100644 --- a/panda/src/rocket/rocketFileInterface.cxx +++ b/panda/src/rocket/rocketFileInterface.cxx @@ -37,9 +37,15 @@ Rocket::Core::FileHandle RocketFileInterface:: Open(const Rocket::Core::String& path) { 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 - return (Rocket::Core::FileHandle) - _vfs->open_read_file(Filename::from_os_specific(path.CString()), true); + return (Rocket::Core::FileHandle) ptr; } ////////////////////////////////////////////////////////////////////