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: Log compiler errors in js config files #915
Conversation
Thanks for the PR! Unfortunately it looks like you left some unlinted code in the commit (maybe you didn't run lint-staged). |
Before this change javascript config files that had compilation errors or that threw their own errors wouldn't report the error, making debugging a mite more difficult than it should be: instead you'd get a useless "TypeError: Cannot read property 'errors' of undefined" message. Now if the javascript config file tosses its cookies for whatever reason we can read what that reason was.
@iiroj Sorry for the delay, fixed. I'd created the initial patch using GitHub's online interface based on a patch-package patch I'd created for one of my projects, and yes that interface doesn't run the linter! |
Codecov Report
@@ Coverage Diff @@
## master #915 +/- ##
===========================================
- Coverage 100.00% 99.83% -0.17%
===========================================
Files 18 18
Lines 609 615 +6
Branches 143 148 +5
===========================================
+ Hits 609 614 +5
- Misses 0 1 +1
Continue to review full report at Codecov.
|
We should ask GitHub to run pre-commit hooks even when their UI is used. That would be rad! |
@okonet Status on merge-ability? |
I have zero time to look at. @iiroj could you review please? 🙏 |
This PR needs additional tests before it can merged. I took the liberty of creating a new branch with a test that covers this case: @kf6kjg feel free to pick the commits into your branch. |
Thank you for the finishing touch! Good to see it completed. |
Before this change javascript config files that had compilation errors or that threw their own errors wouldn't report the error, making debugging a mite more difficult than it should be: instead you'd get a useless
TypeError: Cannot read property 'errors' of undefined
message. Now if the javascript config file tosses its cookies for whatever reason we can read what that reason was.In my case specifically I was accessing a variable before declaring it. Getting
was a LOT more informative than