feat(builder): aggregate validation errors in StreamBuilder.validate() (#631) - #678
Open
ZacLou wants to merge 2 commits into
Open
feat(builder): aggregate validation errors in StreamBuilder.validate() (#631)#678ZacLou wants to merge 2 commits into
ZacLou wants to merge 2 commits into
Conversation
Instead of throwing on the first missing field, collect all issues and throw a single ValidationError with a .issues[] array. Callers can now see all problems at once instead of fixing them one at a time. - Added ValidationError class with issues: string[] - Modified build() to collect all missing required fields - Exported ValidationError from the package entry point Addresses conduit-protocol#631
… upstream merge (conduit-protocol#631) - Export ValidationError from errors.ts and re-export from package index. - Add StreamBuilder.validate() to collect missing-field issues. - Fix nested test regression in builder.test.ts (missing it() close). - Align builder-create-stream-args and network-drop tests with aggregated validation message format. - All lint/typecheck/tests pass locally.
ZacLou
force-pushed
the
fix/631-aggregate-validation-errors
branch
from
September 5, 2026 23:27
8df17f7 to
02a6999
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #631.
Replaces the early-exit missing-parameter check in
build()with avalidate()method that collects every problem before throwing a singleValidationErrorcarrying an.issues[]array.Changes
StreamBuilder.validate(): returns all current validation issues (missingtoken,sender,recipient,amount) as astring[]; empty array means valid.build(): callsvalidate()and raisesValidationErrorwhen issues exist, so a builder missing multiple required fields surfaces every problem at once instead of stopping at the first.ValidationErrorclass (src/errors.ts): exposesreadonly issues: string[]and a summary message. Added toisConduitError()recognition list.