Removing redundant connection error handling to reduce boilerplate