Skip to content

feat(batch): add typed BatchPartiallySubmittedError (closes #601) - #686

Open
Ranjeet2063 wants to merge 1 commit into
conduit-protocol:mainfrom
Ranjeet2063:feat/issue-601-batch-partially-submitted-error
Open

feat(batch): add typed BatchPartiallySubmittedError (closes #601)#686
Ranjeet2063 wants to merge 1 commit into
conduit-protocol:mainfrom
Ranjeet2063:feat/issue-601-batch-partially-submitted-error

Conversation

@Ranjeet2063

Copy link
Copy Markdown

Summary

Adds a typed BatchPartiallySubmittedError carrying firstFailureIndex, skippedIndices, and outcomes, allowing callers to catch and inspect mid-batch failures without manually parsing the outcomes array, and provides the { throwOnPartial: true } option in submitBatch (closes #601).

Key Changes

  • src/errors.ts:
    • Implemented BatchPartiallySubmittedError extending Error with firstFailureIndex, skippedIndices, and outcomes.
    • Added BatchPartiallySubmittedError to isConduitError type guard.
  • src/batch-tx.ts:
    • Added throwOnPartial?: boolean to BatchSubmitOptions.
    • Updated submitBatch to throw BatchPartiallySubmittedError when options.throwOnPartial is true and a failure occurs.
    • Re-exported BatchPartiallySubmittedError.
  • src/index.ts:
    • Re-exported BatchPartiallySubmittedError.
  • src/tests/batch-submit.test.ts:
    • Added tests for BatchPartiallySubmittedError when throwOnPartial is enabled, and verified standard return behavior when omitted.

Verification

  • vitest run src/tests/batch-submit.test.ts: 21/21 tests passing.
  • Clean build with npm run build.

Copilot AI lite review requested due to automatic review settings September 5, 2026 23:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

submitBatch: typed BatchPartiallySubmittedError

2 participants