Error handling in AbstractWriter::write using Zend\Stdlib\ErrorHandler#2370
Conversation
Generalizes the use of Zend\Stdlib\ErrorHandler in all concrete writers while at the same allowing to turn off that feature by calling setConvertWriteErrorsToExceptions on any instance (which makes it safe to use any Writer inside a custom error handler).
There was a problem hiding this comment.
Have you seen the Travis build indicates that your commit has an error? The error can be related to a test or coding standards.
Here, it's an CS issue :
tests/ZendTest/Log/Writer/AbstractTest.php (trailing_spaces)
library/Zend/Log/Writer/AbstractWriter.php (trailing_spaces, braces)
} catch (Exception $e) {You should add import (e.g. use) for the Exception class, and configure your editor to remove trailing spaces auto.
EDIT: ErrorHandler raise an ErrorException instead of Exception, if we have an exception, the cause is not linked to fail on write in a file.
There was a problem hiding this comment.
OK thanks for the info - I use Zend Studio 9, Is the formatter shipped with Studio 9 completely up-to-date o?
- Trailing whitespace - Braces
|
@LowCoders I have no clue if the formatter in Studio follows PSR-2 at this point; I'll drop that team an email to recommend it. I've fixed the CS errors, and merged to master and develop. |
|
Thanks! |
- Trailing whitespace - Braces
Generalizes the use of Zend\Stdlib\ErrorHandler in all concrete writers
while at the same allowing to turn off that feature by calling
setConvertWriteErrorsToExceptions on any instance (which makes it safe
to use any Writer inside a custom error handler).
This is a follow up of a previous pull request #2330 and makes it possible to avoid running into the issue reported on JIRA http://framework.zend.com/issues/browse/ZF2-541