Add error handling for common connect errors.