-
Notifications
You must be signed in to change notification settings - Fork 181
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
Improve error handling #668
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9f40c46
to
bed5d54
Compare
bed5d54
to
cc39843
Compare
…`Exceptions\Handler`
Register CollisionServiceProvider first
863211a
to
0826dda
Compare
e45fb8b
to
493d2c9
Compare
… and add missing command handling
1) src/Providers/CollisionServiceProvider.php (braces) 2) src/Exceptions/Handler.php (unary_operator_spaces, not_operator_with_successor_space, phpdoc_align) 3) src/Bootstrap/HandleExceptions.php (braces, global_namespace_import, unary_operator_spaces, not_operator_with_successor_space, phpdoc_align)
…compiled views in exception traces
…ing inside its test suite
1) src/Providers/ExceptionServiceProvider.php (phpdoc_to_comment, unary_operator_spaces, not_operator_with_successor_space) 2) src/Bootstrap/HandleExceptions.php (phpdoc_to_comment, unary_operator_spaces, not_operator_with_successor_space) 3) tests/TestCase.php (phpdoc_to_comment, unary_operator_spaces, not_operator_with_successor_space)
a458632
to
7aebadc
Compare
damiani
approved these changes
Nov 21, 2022
Love this! 🎉 |
WHOA. Love this! |
Awesome stuff 🚀 |
simonhamp
added a commit
to simonhamp/laravel-mix-jigsaw
that referenced
this pull request
Dec 8, 2022
Lets the build's own errors (nicely output from tighten/jigsaw#668) bubble up to the console when using `npm run watch`
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR makes some long-overdue improvements to Jigsaw's error handling. The code is mostly copied from Laravel and tweak slightly, and lots of Laravel functionality was removed so that we're only implementing what we absolutely need for now.
Highlights
Demo
Here are before and after comparisons for a few possible error scenarios:
1. Undefined variable in Blade template
Before
Build succeeds (this is bad, it should fail), no error output in the console and no indication that anything is wrong. Additionally, the missing variable is rendered as an error visible in the HTML of the built site:
After
Build fails with a nice-looking and detailed error message, including a stack trace pointing to the source of the error in the original, uncompiled Blade template:
2. Invalid expression / syntax error in Blade template
Before
Build fails with a short, ugly error message (in this case it indicates correctly where the error came from, but I've seen it get that wrong or not provide that info at all many times):
After
Build fails with a pretty, detailed error message and stack trace:
3. PHP deprecation
Before
Build succeeds, no error messages, and the deprecation warning is rendered into the output of the site:
After
Build succeeds, but displays warnings in the console, and the error is not rendered into the built HTML:
4. Exception thrown manually
Before
After