-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
fix: re-throw error to kill server #2630
Conversation
Codecov Report
@@ Coverage Diff @@
## v4 #2630 +/- ##
=======================================
Coverage 92.88% 92.88%
=======================================
Files 39 39
Lines 1308 1308
Branches 350 350
=======================================
Hits 1215 1215
Misses 89 89
Partials 4 4
Continue to review full report at Codecov.
|
Are these tests typically flaky? Is it possible to kick off another test run or did I miss a step required for tests? |
@emilyrohrbough should no, server is freeze without throw? |
Yes, without throwing the error, the server fails to start while the webpack compilation continues |
e3ff56c
to
4d1366a
Compare
@evilebottnawi I reverted my changes to see if they had an impact on the test. It seems they are still failing. Do you have any insights on how to resolve these?
|
Update Server.test.js
fe1533c
to
b45b8b8
Compare
@evilebottnawi & @emilyrohrbough Any updates on this? |
@emilyrohrbough can you change branch on v4? |
@evilebottnawi Do you think there is any point of adding error listener if we anyways throwing and killing the server, This will already happen if we don't add listener. |
@Mayank1791989 Some errors can be critical, some of them not, I think so, so we added it, but we probably need a little more tests, maybe you are right and we do not need a listener |
I could see value in both, depending on where / how this is being used, one could catch this error and handle it gracefully or just exit the process. |
@emilyrohrbough Yes, but in our case, we should log it, maybe it is unnecessary here |
Shall I remove the log? |
I think yes, because you already see error message 😄 |
okay great! I'll make that change & fix these merge conflict soon. |
Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@emilyrohrbough Why did you update package-lock.json? I think it's unnecessary |
@hiroppy I did update it. I can revert to the locked in versions. |
…to fix-swallowed-error
…gh/webpack-dev-server into fix-swallowed-error
@hiroppy It seems one or more of the locked in dependencies aren't compatible with node 12. I think the package-lock updates are needed. |
@emilyrohrbough sorry I can't understand. This pr changed only this. this.listeningApp.on('error', (err) => {
this.logger.error(err);
throw err;
}); And v4 branch's CI is fine v10, 12, and 14 even if we don't update package-lock.json. |
@emilyrohrbough This is lint CI. |
Sorry, I misread, I thought your screenshot is v4... |
Thank you for rerunning. ok, understood. So did you run |
@hiroppy |
@emilyrohrbough Thanks! This PR looks good to me and CI is green. |
@hiroppy The build has passed. Are you okay with these changes? |
thanks |
thank you! |
For Bugs and Features; did you add new tests?
Yes
Motivation / Use-Case
Closes #2624
Re-throw an error to kill the server instead of logging and hanging.
Breaking Changes
Process will exit when an error occurs instead of hanging.
Additional Info
Terminal output when error is thrown: