Skip to content

fix: do not show error from preview initialization when stop is called #4271

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 2 commits into from
Jan 8, 2019

Conversation

rosen-vladimirov
Copy link
Contributor

When preview is called with webpack from Public API, if you stop the livesync (via stopLiveSync method) while webpack is still working, in the output you'll see an error as webpack's child process exits with null exit code.
However, this error does not have any meaning for the user, so we shouldn't raise it.
Move the logging of the error to LiveSyncService's handler of previewAppLiveSyncError event - in the described case it will not be raised as LiveSyncService had already removed all listeners.

PR Checklist

When preview is called with webpack from Public API, if you stop the livesync (via stopLiveSync method) while webpack is still working, in the output you'll see an error as webpack's child process exits with `null` exit code.
However, this error does not have any meaning for the user, so we shouldn't raise it.
Move the logging of the error to LiveSyncService's handler of `previewAppLiveSyncError` event - in the described case it will not be raised as LiveSyncService had already removed all listeners.
Currently the `previewAppLiveSyncError` event is handled only when CLI is used as a library. Add handler when CLI is used from command line and use the same workflow in both cases.
Attach to the event every time when a new operation is started. Currently, once LiveSync is stopped, we've removed all handlers and we were never attaching them again. Now we rely on the isInitialized property, so we'll attach the event handler whenever it is needed.
@rosen-vladimirov rosen-vladimirov merged commit 9834826 into release Jan 8, 2019
@rosen-vladimirov rosen-vladimirov deleted the vladimirov/fix-error-preview-stop branch January 8, 2019 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants