Better error handling for `updateDatabase`