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

Commit

Permalink
[zendframework/zendframework#2210] Pass ErrorHandler::stop() result a…
Browse files Browse the repository at this point in the history
…s previous exception

- Per @mark-mabe
- Any place where an exception is throw immediately following an
  ErrorHandler::stop() call should pass the result of that call as the previous
  exception.
  • Loading branch information
weierophinney committed Aug 21, 2012
1 parent 28fda0e commit 766d6d8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Figlet/Figlet.php
Original file line number Diff line number Diff line change
Expand Up @@ -430,10 +430,10 @@ public function render($text, $encoding = 'UTF-8')

ErrorHandler::start(E_NOTICE);
$textLength = iconv_strlen($text, 'UTF-8');
ErrorHandler::stop();
$error = ErrorHandler::stop();

if ($textLength === false) {
throw new Exception\UnexpectedValueException('$text is not encoded with ' . $encoding);
throw new Exception\UnexpectedValueException('$text is not encoded with ' . $encoding, 0, $error);
}

for ($charNum = 0; $charNum < $textLength; $charNum++) {
Expand Down

0 comments on commit 766d6d8

Please sign in to comment.