Repository navigation
Conversation
…lidationFailedError and AssertionFailedError ### Summary of Changes Resolves **F18 (Medium)** from the Uphold Workspace Security & Code Quality Audit: - **Constructor Contract Alignment (F18):** - Updated `ValidationFailedError` (400) and `AssertionFailedError` (500) constructors to evaluate argument arity. - When two or more arguments are provided, `super(status, ...args)` is called to satisfy the documented `(message, properties)` signature without discarding caller properties. - Preserved single-argument compatibility for callers supplying an isolated `errors` violation tree (e.g. `http-request-signature`). - **Regression Coverage & Docs:** - Added test cases in `assertion-failed-error_test.js` and `validation-failed-error_test.js` verifying message and property mapping. - Documented the dual signature behaviour in `README.md`. ### Verification - `node --test test/**/*.js` passes with 58 passing tests and 0 failures.
This branch has not been deployed
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.
Summary of Changes
Resolves F18 (Medium) from the Uphold Workspace Security & Code Quality Audit:
ValidationFailedError(400) andAssertionFailedError(500) constructors to evaluate argument arity.super(status, ...args)is called to satisfy the documented(message, properties)signature without discarding caller properties.errorsviolation tree (e.g.http-request-signature).assertion-failed-error_test.jsandvalidation-failed-error_test.jsverifying message and property mapping.README.md.Verification
node --test test/**/*.jspasses with 58 passing tests and 0 failures.