[go: up one dir, main page]

Skip to content

Rubocop to catch rescuing of StandardError without logging or tracking

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

I think we need a global cop to catch instances where StandardError is rescued but no error is logged and tracked.

This has come up for me a couple times this past milestone.

  1. Errors not bubbled up during incident where build trace chunks were improperly archived
    • We had an incident where build trace chunks were improperly archived and @mfanGitLab found the errors in the postgres logs but we did not find them in the rails logs.
  2. When investigating the BuildKite RFH

Rescuing StandardError without logging it creates "silent failures" that make debugging nearly impossible since you lose all visibility into what went wrong and when. Instead we should try to rescue specific errors whenever possible.

If there is a reason to rescue StandardError we need to use Gitlab::ErrorTracking.track_and_raise_for_dev immediately unless the error is re-raised. This reports the error to Sentry tracking and logs it.

Edited by 🤖 GitLab Bot 🤖