Skip to content
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

build: improve error message for upgrade test helper #27706

Closed

Conversation

devversion
Copy link
Member

@devversion devversion commented Dec 17, 2018

Currently whenever the upgrade test helper fails to load a given AngularJS version, the error that will be rejected is technically not an error because the onerror callback is not returning an error, but an "ErrorEvent".

Since that ErrorEvent is basically just rejected, browsers will print the error as followed:

Failed: [object Event]

This is not helpful at all and also implies that there might be more information hidden within the Event instance. Unfortunately that's not the case (at least on browsers we test against) and the logic to extract the data from the event would be not worth the effort, we just return a simple custom Error that won't imply that there is more information hidden.

@mary-poppins
Copy link

You can preview 477f300 at https://pr27706-477f300.ngbuilds.io/.

@mary-poppins
Copy link

You can preview 7893a3e at https://pr27706-7893a3e.ngbuilds.io/.

@gkalpak gkalpak added refactoring Issue that involves refactoring or code-cleanup comp: upgrade/static labels Dec 17, 2018
@ngbot ngbot bot added this to the needsTriage milestone Dec 17, 2018
Currently whenever the upgrade test helper fails to load a given AngularJS version, the error that will be rejected is technically not an error because the `onerror` callback is not returning an error, but an "ErrorEvent".

Since that `ErrorEvent` is basically just rejected, browsers will print
the error as followed:

```
Failed: [object Event]
```

This is not helpful at all and also implies that there _might_ be more
information hidden within the `Event` instance. Unfortunately that's not
the case (at least on browsers we test against) and the logic to extract
the data from the event would be not worth the effort, we just return a
simple custom `Error` that won't imply that there is more information
hidden.
@devversion devversion force-pushed the build/better-error-task-helpers branch from 7893a3e to 00543b9 Compare December 17, 2018 17:49
@mary-poppins
Copy link

You can preview 00543b9 at https://pr27706-00543b9.ngbuilds.io/.

@devversion devversion added the action: review The PR is still awaiting reviews from at least one requested reviewer label Dec 17, 2018
@gkalpak gkalpak added target: patch This PR is targeted for the next patch release action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Dec 17, 2018
@mhevery mhevery closed this in 87d7b74 Dec 18, 2018
mhevery pushed a commit that referenced this pull request Dec 18, 2018
Currently whenever the upgrade test helper fails to load a given AngularJS version, the error that will be rejected is technically not an error because the `onerror` callback is not returning an error, but an "ErrorEvent".

Since that `ErrorEvent` is basically just rejected, browsers will print
the error as followed:

```
Failed: [object Event]
```

This is not helpful at all and also implies that there _might_ be more
information hidden within the `Event` instance. Unfortunately that's not
the case (at least on browsers we test against) and the logic to extract
the data from the event would be not worth the effort, we just return a
simple custom `Error` that won't imply that there is more information
hidden.

PR Close #27706
ngfelixl pushed a commit to ngfelixl/angular that referenced this pull request Jan 28, 2019
Currently whenever the upgrade test helper fails to load a given AngularJS version, the error that will be rejected is technically not an error because the `onerror` callback is not returning an error, but an "ErrorEvent".

Since that `ErrorEvent` is basically just rejected, browsers will print
the error as followed:

```
Failed: [object Event]
```

This is not helpful at all and also implies that there _might_ be more
information hidden within the `Event` instance. Unfortunately that's not
the case (at least on browsers we test against) and the logic to extract
the data from the event would be not worth the effort, we just return a
simple custom `Error` that won't imply that there is more information
hidden.

PR Close angular#27706
@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 14, 2019
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 cla: yes refactoring Issue that involves refactoring or code-cleanup target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants