Throw a new exception if the file fails to load

With out this change if the file fails to open then any further method calls fail with "Database has been closed." which is misleading.