Closed marcioAlmada closed 7 years ago
@marcioAlmada, thanks for your PR! By analyzing the history of the files in this pull request, we identified @bwoebi to be a potential reviewer.
Funny thing is that this bug occurs within aerys but I can't reproduce in isolation 🤔
This is why one does use an error handler like:
set_error_handler(function($errno, $errstr, $file, $line) {
if (error_reporting()) { // because the @-operator will set error_reporting() === 0
throw new \Exception("{$errstr} in {$file}:{$line}", $errno);
}
});
An if (is_resource())
check will only catch one of the potentially warning conditions. Hence it's better to not merge this and just have your error handler handle it properly.
It concerns me to see untreated warnings in the logs. But I think patching the error handler makes more sense than patching amphp/mysql.
:+1:
Prevents warning when closing connection:
Otherwise aerys application gets unusable with error handlers like: