Skip to content

Fbe::Iterate#over loses repo and item context when block raises an exception #446

@morphqdd

Description

@morphqdd

In iterate.rb, yield(repo, nxt) is called without a rescue block:

before[repo] =
  if nxt.nil?
    # ...
  else
    @loog.debug("Next is ##{nxt}, starting from it")
    yield(repo, nxt)   # raises StandardError → no context logged
  end

The existing rescue at the end of over catches only Fbe::OffQuota. Any other exception propagates up with no information about which repository (repo) or which item (nxt) caused the failure.

In production this makes debugging iteration failures extremely difficult — the stacktrace shows the exception type but not the repository or fact being processed at the time of the crash.

What should happen: the yield call should preserve context before re-raising, e.g.:

begin
  yield(repo, nxt)
rescue => e
  raise "#{e.class} in #{repo} at #{nxt}: #{e.message}"
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions