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

display_errors setting being set to 1 does not show errors in browser. #74

Closed
4 tasks done
dennis-fedco opened this issue May 14, 2020 · 2 comments
Closed
4 tasks done

Comments

@dennis-fedco
Copy link

What ZF application I'm using when issue happen ?

  • Mezzio 3

What PHP version you're using?

  • PHP 7.4

What ErrorHeroModule version you're using?

  • ^2.0

What Database you're using?

  • MySQL version 8.0

Expected behavior

Show exact error message in the browser, and log the error message in the error log.

Actual behavior

No error is shown, but my application has null values when I expect values. The exact error message is not shown explicitly even though effects of the error are evident by observing that my application is not working as expected.

Steps/Codes to reproduce the behavior

When in the hero config file I set ['display-settings']['display_errors'] to 0, the exact error of the application is written into the log, which is helpful in debugging the error. But when I set ['display-settings']['display_errors'] to 1, my application does not show explicit error in the browser, and no error message is written into the log, even though it is evident that my application is affected by the (unknown/unlogged) error.

Thus I feel like there is more to ['display-settings']['display_errors'] setting than I am aware of. What happens when ['display-settings']['display_errors'] is set to 1, because I do not see the error in the browser, or any of the logs.

Looking in the ErrorHeroModule code briefly it looks like the setting being 0 turns off ErrorHeroModule handling of the error and pushes it back to MVC module. I am not sure what it means, but it may explain why error is not logged, and why I may not be getting an error message displayed in my browser.

@samsonasik
Copy link
Owner

samsonasik commented May 15, 2020

I can't reproduce, when I set display_errors to 1, it display the error:

Screen Shot 2020-05-15 at 2 09 04 PM

and save the log to db:

Screen Shot 2020-05-15 at 2 09 43 PM

For saving same error to db, it uses interval for new record:

// config/autoload/mezzio-error-hero-module.local.php
<?php 

return [
    // ...
   'logging-settings' => [
        'same-error-log-time-range' => 86400,
    ],
    // ...
];

Please also check if cache is enabled.

If you have a persist issue, please provide a minimal reproducible repo or unit test.

@samsonasik
Copy link
Owner

I'm closing it. If you have a persist issue, please provide a minimal reproducible repo or unit test.

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

No branches or pull requests

2 participants