Skip to content

Learn/crawl/nitin ex1 orientation#202

Closed
sanghinitin wants to merge 2 commits into
mainfrom
learn/crawl/nitin-ex1-orientation
Closed

Learn/crawl/nitin ex1 orientation#202
sanghinitin wants to merge 2 commits into
mainfrom
learn/crawl/nitin-ex1-orientation

Conversation

@sanghinitin

@sanghinitin sanghinitin commented May 19, 2026

Copy link
Copy Markdown
Contributor

Error fix using GHCP learning

Description

Enhanced EcErrorHandler with transient error classification, error counting, consistent exit-status enforcement, and expanded rescue clauses in backup/restore/import commands.

Changes:

  • Added TRANSIENT_ERRORS constant to classify network/server errors (ECONNRESET, ECONNREFUSED, ETIMEDOUT, EHOSTUNREACH)
  • Added error_count tracking and has_errors? predicate
  • Added transient_error?(ex) method to tag errors as transient vs permanent in error logs
  • at_exit hook now enforces exit 1 when errors occurred (even with -VVV flag)
  • Added suppress_exit: option for testability
  • Expanded rescue clauses in ec_backup.rb, ec_restore.rb, ec_import.rb to catch Net::HTTPFatalError and Errno::ECONNRESET/ECONNREFUSED/ETIMEDOUT
  • Added require 'digest' guard in ec_base.rb for Ruby >= 3.2 compatibility
  • 22 RSpec examples covering all new behavior

AI Track: Walk / Exercise 1 (Repo Orientation + Low-Risk Module)

Related Issue

GHCP Learning Track – Crawl/Walk exercise 1: repo orientation and low-risk module improvement.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Chore (non-breaking change that does not add functionality or fix an issue)

Checklist:

  • I have read the CONTRIBUTING document.
  • I have run the pre-merge tests locally and they pass.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • If Gemfile.lock has changed, I have used --conservative to do it and included the full output in the Description above.
  • All new and existing tests passed.
  • All commits have been signed-off for the Developer Certificate of Origin.

@sanghinitin sanghinitin requested review from a team as code owners May 19, 2026 11:30
@sanghinitin sanghinitin marked this pull request as draft May 19, 2026 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant