Skip to content

Fix NoMethodError if the wiki repository raise an error

  • Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA

What does this MR do and why?

This MR fixes the issue Follow-up from "Fix view wiki pages that contai... (#467352 - closed)

I see NoMethodError failures in the logs because matched_files can return false.

See https://nonprod-log.gitlab.net/app/discover#/doc/ed942d00-5186-11ea-ad8a-f3610a492295/pubsub-rails-inf-gstg-001712?id=qM1ID5AB7UTw2XCLwX72

The root cause was in the method capture_git_error which always returned false when an exception was raised. The solution applied was to parameterize the returned value of capture_git_error in cases of error.

Edited by 🤖 GitLab Bot 🤖

Merge request reports

Loading