Skip to content

Commit

Permalink
no exceptions handling in __toString
Browse files Browse the repository at this point in the history
  • Loading branch information
vearutop committed Mar 29, 2017
1 parent 80f7ae7 commit 00b54f7
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions src/AbstractTemplate.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,13 @@ protected function prepare()

public function __toString()
{
try {
if (!$this->preparedOnce) {
$this->prepareOnce();
$this->preparedOnce = true;
}
$this->prepare();

return $this->toString();
} catch (\Exception $exception) {
return 'Error: (' . $exception->getCode() . ') ' . $exception->getMessage()
. "\n" . $exception->getTraceAsString();
} catch (\Error $exception) {
return 'Error: (' . $exception->getCode() . ') ' . $exception->getMessage()
. "\n" . $exception->getTraceAsString();

if (!$this->preparedOnce) {
$this->prepareOnce();
$this->preparedOnce = true;
}
$this->prepare();

return $this->toString();
}


Expand Down

0 comments on commit 00b54f7

Please sign in to comment.