Fix regression error in Environment model reactive cache
We merged !85105 (diffs) to fix #350729 (closed) .
But error.error_code
is not available for Gitlab::UrlBlocker::BlockedUrlError
as noticed in logs https://log.gprd.gitlab.net/goto/afd212b0-c174-11ec-afaf-2bca15dfbf33
In the proposed MR, we safely navigate using error.try(:error_code)
and includes enhanced test cases for all the ignored connection errors.
Related to #360163 (closed)
Edited by Bala Kumar