Skip to content

fix(@angular-devkit/architect): propagate option validation errors #14274

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 26, 2019

Conversation

clydin
Copy link
Member

@clydin clydin commented Apr 26, 2019

By using the SchemaValidationException object, the underlying JSON schema validation errors will be propagated to the consuming code. This allows for more detailed error reporting of malformed or incorrectly provided options.

Partially addresses #14269

@clydin clydin added the target: patch This PR is targeted for the next patch release label Apr 26, 2019
@clydin clydin requested a review from filipesilva April 26, 2019 01:33
Copy link
Contributor

@filipesilva filipesilva left a comment

Choose a reason for hiding this comment

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

Can you add tests for the contents of these two errors?

The second one can be validated by replacing

try {
await run2.output.toPromise();
expect('THE ABOVE LINE SHOULD NOT ERROR').toBe('false');
} catch {}

With

    try {
      await run2.output.toPromise();
      expect('THE ABOVE LINE SHOULD NOT ERROR').toBe('false');
    } catch (error) {
      expect(error.message).toContain(`Data path "" should have required property 'p1'`);
    }

The first one doesn't have a matching test I think.

    By using the `SchemaValidationException` object, the underlying JSON schema validation errors will be propagated to the consuming code.  This allows for more detailed error reporting of malformed or incorrectly provided options.

Partially addresses angular#14269
@clydin clydin force-pushed the architect-json-errors branch from feb04a9 to 39f52a2 Compare April 26, 2019 14:06
@alexeagle alexeagle merged commit 5f24820 into angular:master Apr 26, 2019
@clydin clydin deleted the architect-json-errors branch April 26, 2019 17:28
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
hotlist: release-blocker target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants