Skip to content

fix: segregate error during CircuitBuilder usage

This PR implements robust error classification during two-hop circuit construction via tor_circmgr::CircuitBuilder.

Previously, all failures were treated uniformly as relay-to-relay partition failures. Now, errors are segregated into meaningful categories such as:

  • Partition – for actual unreachable relays (e.g., os error 101, 113, 111)
  • Timeout – for circuit or channel timeouts
  • Transient – for recoverable or system-level issues (e.g., file descriptor exhaustion)
  • FirstHopFailed – for early relay negotiation failures
  • Unknown – for uncategorized/unrecognized errors

Screenshot

image

image

Changes

  • Introduced CircuitFailureReason enum in work.rs
  • Implemented centralized error classification logic in client.rs
  • Enhanced logging with clear reason + error cause
  • Adjusted match patterns for clarity and CI compliance

This enables better post-processing in Neo4j and prepares the project for advanced partition detection.

Closes: #18

Signed-off-by: harshita_roonwal roonwal721972@gmail.com

Merge request reports

Loading