Skip to content
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

Debugger: shows error message in console #486

Merged
merged 1 commit into from
May 19, 2021
Merged

Debugger: shows error message in console #486

merged 1 commit into from
May 19, 2021

Conversation

mabar
Copy link
Contributor

@mabar mabar commented May 19, 2021

I just don't think there is a reason to not show error message in console. But I may be wrong, let me know if I missed something.

@mabar
Copy link
Contributor Author

mabar commented May 19, 2021

Output looks like this:

ERROR: Ello there, I am veri broken app.
Error was logged. Enable debug mode to see more info.

Build failure is unrelated to the PR, symplify/ecs seems to be broken.

@dg
Copy link
Member

dg commented May 19, 2021

I wouldn't put a sentence Enable debug mode to see more info. there. To see more, see log. That error may not occur again.

@mabar
Copy link
Contributor Author

mabar commented May 19, 2021

I usually enable debug mode, to see stack trace, etc. Writing into log may fail.

What about To see more, enable debug mode. and To see more, enable debug mode or check log. in case error was logged?

@dg
Copy link
Member

dg commented May 19, 2021

If it's been logged, there's no need to do anything.

@mabar
Copy link
Contributor Author

mabar commented May 19, 2021

If it's been logged, there's no need to do anything.

Good point, changed.

With log

ERROR: Ello there, I am veri broken app.
Check log to see more info.

Without log

ERROR: Ello there, I am veri broken app.
Unable to log error. You may try enable debug mode to inspect the problem.

@dg
Copy link
Member

dg commented May 19, 2021

Great!

@dg dg changed the title Always show error message in console Debugger: shows error message in console May 19, 2021
@dg dg merged commit 5392c3b into nette:master May 19, 2021
@mabar mabar deleted the console-error branch May 19, 2021 11:37
@@ -319,8 +319,12 @@ public static function exceptionHandler(\Throwable $exception): void
require self::$errorTemplate ?: __DIR__ . '/assets/error.500.phtml';
})(empty($e));
} elseif (PHP_SAPI === 'cli') {
@fwrite(STDERR, 'ERROR: application encountered an error and can not continue. '
. (isset($e) ? "Unable to log error.\n" : "Error was logged.\n")); // @ triggers E_NOTICE when strerr is closed since PHP 7.4
// @ triggers E_NOTICE when strerr is closed since PHP 7.4
Copy link

@Ciki Ciki Jun 7, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dg there's a typo strerr should be stderr

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

serepes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants