BaseError sanitizes debug_error_string, which we do to avoid leaking details to the user and polluting Sentry.
BaseError
debug_error_string
This inheritance means code that rescues Gitlab::Git::BaseError needs to rescue Gitlab::Git::Repository::NoRepository earlier.
Gitlab::Git::BaseError
Gitlab::Git::Repository::NoRepository
Relates to #238465