/** * {@inheritDoc} */ public function onPostExecute(Context $context) { if ($context->getReply()) { $this->logger->debug(sprintf('[Payum] %d# %s::execute(%s) throws reply %s', count($context->getPrevious()) + 1, Humanify::value($context->getAction()), Humanify::request($context->getRequest()), Humanify::request($context->getReply()))); } elseif ($context->getException()) { $this->logger->debug(sprintf('[Payum] %d# %s::execute(%s) throws exception %s', count($context->getPrevious()) + 1, $context->getAction() ? Humanify::value($context->getAction()) : 'Gateway', Humanify::request($context->getRequest()), Humanify::value($context->getException()))); } }
protected function onPostExecuteWithException(Context $context) { array_pop($this->stack); $exception = $context->getException(); try { $this->extensions->onPostExecute($context); } catch (\Exception $e) { // logic is similar to one in Symfony's ExceptionListener::onKernelException $wrapper = $e; while ($prev = $wrapper->getPrevious()) { if ($exception === ($wrapper = $prev)) { throw $e; } } $prev = new \ReflectionProperty('Exception', 'previous'); $prev->setAccessible(true); $prev->setValue($wrapper, $exception); throw $e; } if ($context->getException()) { throw $context->getException(); } }