-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve custom s9y error handling. Will post in issue #399 for details.
- Loading branch information
1 parent
a615ddc
commit 98099b6
Showing
2 changed files
with
192 additions
and
1 deletion.
There are no files selected for viewing
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
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
98099b6
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.
@garvinhicking I updated my devblog to the current alpha to be able to test especially this commit. It does not seem to work, I see no change with the stacktrace in http://onli.columba.uberspace.de/s9y_dev/, while the code says he would also update " == ERROR-REPORT (BETA/ALPHA-BUILDS) == \n"; and wrap the stacktrace in a pre-trag.
98099b6
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.
@onli Don't know, works for me. Can you debug? Does the errorhandler get called at all, add a die('blabla') as the first line in the function? If not, does set_error_handler() get called? Did you set $serendipity['production']=true in serendipity_config_local.inc.php?!
98099b6
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.
Sure. You ran this on PHP7, but not on uberspace?
No, it does not get called.
Yes, at least the line is reached, I added an echo there in serendipity_config.inc.php.
No, and I wrapped it in an if at the point of where the error is in the index.php and it is not true.
98099b6
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.
Is
echo "error"->is_array();
a type of error he should catch?98099b6
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.
@onli Yes I ran this on my own Debian machine with mod-PHP and Apache2.
You might be onto something, it could be that Fatal Errors cannot be caught by us. Try with something that raises a warning, like file_get_contents('file/that/does/not/exist.txt'), I tried it with that...
98099b6
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.
Bingo. Now it gets triggered. Good to know! :)
It leads me to another issue: Is stopping s9y really what we want here? This is what happens with the error handler:
This without:
The warning gets written on top. I take it that is the wanted behaviour on alpha/beta to see the stacktrace?
98099b6
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.
Exactly, it's so that we definitely get warnings reported - on release versions this would not happen