public function registerPlugin(SimpleFactoryInterface $factory) { try { $this->register($factory); $this->registered = true; } catch (Error $ex) { $this->throwException($ex); } catch (Exception $ex) { $this->throwException($ex); } return $this; }