protected function catchException(core\exception $e, fs\file $file = null) { if ($this->useLog()) { $this->getLogger()->addException($e->getMessage()); } if ($file) { $e->addPath($file->asToken()); } else { $e->addPath('No file defined'); } if ($this->throwExceptions()) { throw $e; } else { $e->save(false); } }
protected function catchExceptionCheck($sException, dom\element $test, core\exception $e, fs\file $file) { $bResult = false; if ($sException && $e instanceof $sException) { $bResult = true; } else { $e->addPath($file->asToken()); $e->addPath('Test ID : ' . $test->readAttribute('name')); if ($sException) { $e->addPath(sprintf('Exception of type %s expected', $sException)); } //$e->addPath($test->asString()); $e->save(false); } return $bResult; }