Skip to content

Conversation

@antongolub
Copy link
Collaborator

@antongolub antongolub commented Jul 24, 2025

  • Tests pass
  • Appropriate changes to README are included in PR

@antongolub antongolub requested review from antonmedv and Copilot July 24, 2025 20:56
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a new Fail class that consolidates error handling functionality across the zx library. The class serves as a centralized error object that extends the native Error class and includes static methods for formatting error messages, exit codes, and caller locations.

  • Replaces scattered error utility functions with a unified Fail class
  • Migrates existing error formatting functions to static methods on the Fail class
  • Updates all error instantiations throughout the codebase to use Fail instead of Error

Reviewed Changes

Copilot reviewed 17 out of 20 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/error.ts Refactors error utility functions into a new Fail class with static methods
src/core.ts Updates to use Fail class for error handling and exports the new class
src/goods.ts Replaces Error with Fail for error instantiation
src/deps.ts Updates error throwing to use Fail class
src/cli.ts Integrates Fail class and uses its DOCS_URL constant
test/error.test.ts Updates test imports to use Fail class static methods
test/core.test.js Adds test coverage for Fail class functionality
test/export.test.js Adds export validation tests for Fail class and its properties
build/*.js Generated build files reflecting the new Fail class integration

@antongolub antongolub merged commit ab7e109 into google:main Jul 27, 2025
28 checks passed
@antongolub antongolub deleted the feat-fail branch July 27, 2025 06:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant