-
-
Notifications
You must be signed in to change notification settings - Fork 221
Feature Request: Add last error panel to bluescreen #133
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
Conversation
|
👍 |
2 similar comments
|
👍 |
|
👍 |
|
@JanTvrdik I would start simple and just implement it naively and if there are some cases where the info is irelevant, we might iterate on that after. |
Announcement to all talented programmersThis is your last chance to implement this awesome idea. If there will be no PR at 20.00 today, I'll do it myself and you will loose the unique opportunity to became famous for implementing this. |
|
😀 |
593921b to
70ef7f2
Compare
|
Any thoughts? |
|
@JanTvrdik maybe it would be nice to hide the error, if the rendered exception is ErrorException created by nette handler and the error would be exactly the same? |
|
@fprochazka I know but I don't see a simple and reliable way to write the condition. You may check ErrorException + file + line but it may have some false positives. |
|
ping @dg, is this ok? should i fix tests? |
| <h2><a data-tracy-ref="^+" class="tracy-toggle tracy-collapsed">Last error</a></h2> | ||
| <div class="tracy-collapsed inner"> | ||
|
|
||
| <h2><?= Helpers::errorTypeToString($error['type']) ?>: <?= htmlspecialchars($error['message'], ENT_IGNORE, 'UTF-8') ?></h2> |
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.
Inside H2 should be H3.
5dd8d3e to
5ecd8e7
Compare
7f3fd63 to
bbc898e
Compare
d95bc4c to
a7b64a4
Compare
|
😫 I've put hours of energy into an attempt to fix the tests and it's still not done. This is ridiculous. 😫 |
| ? $source . (strpos($source, '?') ? '&' : '?') . '_tracy_skip_error' | ||
| : NULL; | ||
| $lastError = (!$exception instanceof \ErrorException) ? error_get_last() : NULL; | ||
|
|
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.
$lastError = $exception instanceof \ErrorException ? NULL : error_get_last(); seems better

In PHP it is quite common to use "shut-up + escalating error to exception" pattern (example). Unfortunately the original error message is lost unless
error_get_last()['message']is manually appended to exception message.What about adding a simple panel to bluescreen to show the last error? The error may not always be related. We may attempt to do some magic to filter the relevant error but I'm not sure it's worth it.
Related: nette/utils#94