File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
src/Bridges/ApplicationDI Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -47,8 +47,16 @@ public function __invoke(string $class): Nette\Application\IPresenter
4747 touch ($ this ->touchToRefresh );
4848 }
4949
50- $ presenter = $ this ->container ->createInstance ($ class );
51- $ this ->container ->callInjects ($ presenter );
50+ try {
51+ $ presenter = $ this ->container ->createInstance ($ class );
52+ $ this ->container ->callInjects ($ presenter );
53+ } catch (Nette \DI \MissingServiceException | Nette \DI \ServiceCreationException $ e ) {
54+ if ($ this ->touchToRefresh && class_exists ($ class )) {
55+ throw new \Exception ("Refresh your browser. New presenter $ class was found. " , 0 , $ e );
56+ }
57+ throw $ e ;
58+ }
59+
5260 if ($ presenter instanceof Nette \Application \UI \Presenter && $ presenter ->invalidLinkMode === null ) {
5361 $ presenter ->invalidLinkMode = $ this ->invalidLinkMode ;
5462 }
You can’t perform that action at this time.
0 commit comments