public function onError(EventInterface $event) { if (!isset($this->handlers[$this->current])) { throw new RuntimeException("{$this->current} is not supported. Add it use addHandler({$this->current}, <className>) func."); } if (!$event->getException() instanceof Exception) { return $event; } $whoops = new Run(); $whoops->pushHandler($this->handlers[$this->current]); $whoops->pushHandler(function ($exception, $inspector, $run) use($event) { $run->sendHttpCode($exception->getCode()); }); $whoops->register(); throw $event->getException(); }