Skip to content

fix(utils): replace catch {} with error logging in tri_utils.zig corpus/index saves #182

@gHashTag

Description

@gHashTag

Task

In src/tri/tri_utils.zig, lines 322, 327, 365, 373 silently swallow errors on corpus/index operations:

corpus.loadInto(TVC_CORPUS_PATH) catch {};  // line 322
ctx_mgr.loadIndex() catch {};               // line 327
mgr.saveIndex() catch {};                   // line 365
corpus.save(TVC_CORPUS_PATH) catch {};      // line 373

These are file I/O operations that can fail for real reasons (disk full, permissions, etc).

Fix

Replace each with error logging:

corpus.loadInto(TVC_CORPUS_PATH) catch |err| {
    std.log.debug("corpus load: {s}", .{@errorName(err)});
};

Same pattern for all 4 instances. Use std.log.debug since load failures on first run are expected.

File

  • src/tri/tri_utils.zig — lines 322, 327, 365, 373

Acceptance

  • zig build compiles without errors
  • zig fmt passes
  • All 4 catch {} replaced with error logging

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent:spawnAuto-spawn agent container

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions