You should catch the exception possibly thrown by loadPackageConfig().
Otherwise, it might be simpler to load the data at startup time and just return an error if the data is not available.