more rebust error handling in the data-access code, specifically in cases where the initial database connection failes