| 1 | <?php |
||
| 18 | class ErrorHandler |
||
| 19 | { |
||
| 20 | /** |
||
| 21 | * Stores the valid handlers. |
||
| 22 | * |
||
| 23 | * @var \Tobscure\JsonApi\Exception\Handler\ExceptionHandlerInterface[] |
||
| 24 | */ |
||
| 25 | private $handlers = []; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Handle the exception provided. |
||
| 29 | * |
||
| 30 | * @param Exception $e |
||
| 31 | * |
||
| 32 | * @throws RuntimeException |
||
| 33 | * |
||
| 34 | * @return \Tobscure\JsonApi\Exception\Handler\ResponseBag |
||
| 35 | */ |
||
| 36 | 3 | public function handle(Exception $e) |
|
| 46 | |||
| 47 | /** |
||
| 48 | * Register a new exception handler. |
||
| 49 | * |
||
| 50 | * @param \Tobscure\JsonApi\Exception\Handler\ExceptionHandlerInterface $handler |
||
| 51 | * |
||
| 52 | * @return void |
||
| 53 | */ |
||
| 54 | public function registerHandler(ExceptionHandlerInterface $handler) |
||
| 58 | } |
||
| 59 |