Skip to content

Conversation

AndrewKushnir
Copy link
Contributor

Prior to this commit, decorator handling logic in Ngtsc used Error to throw errors. This commit replaces most of these instances with FatalDiagnosticError class, which provider a better diagnostics error (including location of the problematic code).

This PR also adds tests for all places where Error was replaced with FatalDiagnosticError.

Resolves #34958.

PR Type

What kind of change does this PR introduce?

  • Feature

Does this PR introduce a breaking change?

  • Yes
  • No

@AndrewKushnir AndrewKushnir added feature Issue that requests a new feature action: review The PR is still awaiting reviews from at least one requested reviewer target: patch This PR is targeted for the next patch release comp: ivy area: compiler Issues related to `ngc`, Angular's template compiler labels Feb 7, 2020
@AndrewKushnir AndrewKushnir requested a review from alxhub February 7, 2020 22:14
@ngbot ngbot bot modified the milestone: needsTriage Feb 7, 2020
@AndrewKushnir AndrewKushnir force-pushed the use-fatal-diagnostic-error branch from 4cd17b8 to 961e07e Compare February 7, 2020 22:16
@AndrewKushnir AndrewKushnir marked this pull request as ready for review February 7, 2020 22:56
@alxhub
Copy link
Member

alxhub commented Feb 19, 2020

Also, I would consider this fix(compiler) not feat(compiler) - it's a bug if we crash instead of give real error messages.

@AndrewKushnir AndrewKushnir force-pushed the use-fatal-diagnostic-error branch from 961e07e to fa3830b Compare February 19, 2020 23:35
@AndrewKushnir AndrewKushnir added type: bug/fix and removed feature Issue that requests a new feature labels Feb 19, 2020
@AndrewKushnir AndrewKushnir changed the title feat(compiler): use FatalDiagnosticError to generate better error messages fix(compiler): use FatalDiagnosticError to generate better error messages Feb 19, 2020
…ages

Prior to this commit, decorator handling logic in Ngtsc used `Error` to throw errors. This commit replaces most of these instances with `FatalDiagnosticError` class, which provider a better diagnostics error (including location of the problematic code).
@AndrewKushnir AndrewKushnir force-pushed the use-fatal-diagnostic-error branch from 57c5f9d to 2c767ad Compare February 19, 2020 23:43
@AndrewKushnir AndrewKushnir added action: presubmit The PR is in need of a google3 presubmit and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Feb 19, 2020
@AndrewKushnir
Copy link
Contributor Author

Thanks for the review @alxhub! I've applied the changes (to the code and commit msg) as you proposed.

@AndrewKushnir
Copy link
Contributor Author

Presubmit

@AndrewKushnir AndrewKushnir removed the action: presubmit The PR is in need of a google3 presubmit label Feb 20, 2020
@AndrewKushnir AndrewKushnir added action: merge The PR is ready for merge by the caretaker action: presubmit The PR is in need of a google3 presubmit and removed action: presubmit The PR is in need of a google3 presubmit labels Feb 20, 2020
mhevery pushed a commit that referenced this pull request Feb 20, 2020
…ages (#35244)

Prior to this commit, decorator handling logic in Ngtsc used `Error` to throw errors. This commit replaces most of these instances with `FatalDiagnosticError` class, which provider a better diagnostics error (including location of the problematic code).

PR Close #35244
@mhevery mhevery closed this in 646655d Feb 20, 2020
@AndrewKushnir
Copy link
Contributor Author

@mhevery only pre-existing failing targets are present in TAP presubmit after re-run, so this PR is ready to go. Thank you.

@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 Mar 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker area: compiler Issues related to `ngc`, Angular's template compiler cla: yes target: patch This PR is targeted for the next patch release type: bug/fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error in @ViewChild While migrating from angular 8 to 9
3 participants