2017 © Pedro Peláez
 

library php-error-handler

Exception handler for php to customise behavior given a specific exception code

image

letsface/php-error-handler

Exception handler for php to customise behavior given a specific exception code

  • Friday, July 24, 2015
  • by sylvainv
  • Repository
  • 7 Watchers
  • 0 Stars
  • 16 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

php-error-handler

Exception handler for php to customise behavior given a specific exception code, (*1)

Usage

Custom handler

$handler = new \Letsface\ExceptionHandler();
$handler->listen('123', function() {
  return 'foo';
});

try {
  throw new \MyException('', '123');
}
catch(\Exception $e) {
  // will echo "foo";
  echo $handler->handle($e);
}

Throw an exception

$handler = new \Letsface\ExceptionHandler();
$handler->throws('123', new \AnotherException('My new message', 'NEWCODE'));

try {
  throw new \MyException('', '123');
}
catch(\Exception $e) {
  // will throw "\AnotherException";
  $handler->handle($e);
}

Rethrow the exception

$handler = new \Letsface\ExceptionHandler();
$handler->rethrow('123');

try {
  throw new \MyException('', '123');
}
catch(\Exception $e) {
  // will throw $e;
  $handler->handle($e);
}

The Versions

24/07 2015

dev-master

9999999-dev https://github.com/letsface/php-error-handler

Exception handler for php to customise behavior given a specific exception code

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar sylvainv

exception

24/07 2015

v1.2

1.2.0.0 https://github.com/letsface/php-error-handler

Exception handler for php to customise behavior given a specific exception code

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar sylvainv

exception

23/07 2015

v1.1

1.1.0.0 https://github.com/letsface/php-error-handler

Exception handler for php to customise behavior given a specific exception code

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar sylvainv

exception

23/07 2015

v1.0

1.0.0.0 https://github.com/letsface/php-error-handler

Exception handler for php to customise behavior given a specific exception code

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar sylvainv

exception