Use custom error types for connection errors.