Skip to content
This repository has been archived by the owner on Feb 4, 2022. It is now read-only.

Commit

Permalink
Issue #88: Remove onException event
Browse files Browse the repository at this point in the history
- Remove EventPublisherException
- Remove EventException
- Change dispatcher to register 'fail' directly with the exception handler as a callback
  • Loading branch information
johanjanssens committed May 16, 2016
1 parent fc1708f commit 1f88fad
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 276 deletions.
8 changes: 2 additions & 6 deletions code/dispatcher/abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function __construct(ObjectConfig $config)
$this->addCommandCallback('before.dispatch', '_resolveRequest');

//Register the default exception handler
$this->getObject('event.publisher')->addListener('onException', array($this, 'fail'));
$this->getObject('exception.handler')->addExceptionCallback(array($this, 'fail'));
}

/**
Expand Down Expand Up @@ -314,11 +314,7 @@ protected function _actionFail(DispatcherContextInterface $context)
}

//Get the exception object
if($context->param instanceof EventException) {
$exception = $context->param->getException();
} else {
$exception = $context->param;
}
$exception = $context->param;

//If the error code does not correspond to a status message, use 500
$code = $exception->getCode();
Expand Down
129 changes: 0 additions & 129 deletions code/event/exception.php

This file was deleted.

140 changes: 0 additions & 140 deletions code/event/publisher/exception.php

This file was deleted.

2 changes: 1 addition & 1 deletion code/event/publisher/publisher.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
* @author Johan Janssens <https://github.com/johanjanssens>
* @package Kodekit\Library\Event\Publisher
*/
class EventPublisher extends EventPublisherException implements ObjectSingleton {}
class EventPublisher extends EventPublisherAbstract implements ObjectSingleton {}

0 comments on commit 1f88fad

Please sign in to comment.