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.
Merge pull request #1 from blueboxes/patch-1

Throw a new exception if the file fails to load