Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Jan 8, 2020. It is now read-only.

Error handling in AbstractWriter::write using Zend\Stdlib\ErrorHandler#2370

Closed
ghost wants to merge 1 commit into
masterfrom
unknown repository
Closed

Error handling in AbstractWriter::write using Zend\Stdlib\ErrorHandler#2370
ghost wants to merge 1 commit into
masterfrom
unknown repository

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Sep 16, 2012

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

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).
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

OK thanks for the info - I use Zend Studio 9, Is the formatter shipped with Studio 9 completely up-to-date o?

weierophinney added a commit that referenced this pull request Sep 18, 2012
- Trailing whitespace
- Braces
weierophinney added a commit that referenced this pull request Sep 18, 2012
@weierophinney
Copy link
Copy Markdown
Member

@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.

@ghost ghost assigned weierophinney Sep 18, 2012
@ghost
Copy link
Copy Markdown
Author

ghost commented Sep 19, 2012

Thanks!

weierophinney added a commit to zendframework/zend-log that referenced this pull request May 15, 2015
- Trailing whitespace
- Braces
weierophinney added a commit to zendframework/zend-log that referenced this pull request May 15, 2015
weierophinney added a commit to zendframework/zend-log that referenced this pull request May 15, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants