Error when entering an invalid URL on 'Mirroring repositories'

Summary

On repository settings, when entering an invalid URL on "Git repository URL" and clicking "Mirror Repository" after that, GitLab returns a 500

Steps to reproduce

  1. Go to Settings -> Repository
  2. Expand "Mirroring repositories"
  3. Add an invalid URL like http://192.168.10.1:1op/test.git
  4. Click on "Mirror Repository"

What is the current bug behavior?

Gitlab.com returns a 500 error

What is the expected correct behavior?

Return a proper error message

Relevant logs and/or screenshots

mirroring_repository_error

Output of checks

This bug happens on GitLab.com