77use App \Model \Acl \Repositories \RoleRepository ;
88use App \Model \Acl \Role ;
99use App \Model \Settings \Commands \SetSettingBoolValue ;
10- use App \Model \Settings \Exceptions \SettingsItemNotFoundException ;
1110use App \Model \Settings \Queries \SettingBoolValueQuery ;
1211use App \Model \Settings \Settings ;
1312use App \Model \Structure \Repositories \SubeventRepository ;
1716use App \Services \QueryBus ;
1817use Contributte \Console \Application ;
1918use Doctrine \Common \Collections \ArrayCollection ;
20- use Doctrine \DBAL \Exception \TableNotFoundException ;
2119use Doctrine \Migrations \Tools \Console \Command \MigrateCommand ;
2220use Doctrine \ORM \EntityManagerInterface ;
2321use Exception ;
2422use Nette \Application \AbortException ;
2523use Skautis \Skautis ;
2624use Skautis \Wsdl \WsdlException ;
2725use Symfony \Component \Console \Input \ArrayInput ;
26+ use Symfony \Component \Messenger \Exception \HandlerFailedException ;
2827use Throwable ;
2928use Tracy \Debugger ;
3029use Tracy \ILogger ;
@@ -84,8 +83,8 @@ public function renderDefault(): void
8483
8584 $ this ->flashMessage ('install.schema.schema_already_created ' , 'info ' );
8685 $ this ->redirect ('admin ' );
87- } catch (TableNotFoundException $ ex ) {
88- } catch ( SettingsItemNotFoundException $ ex ) {
86+ } catch (HandlerFailedException $ ex ) {
87+ // ignoruje se, tabulky ještě nejsou vytvořeny
8988 }
9089 }
9190
@@ -126,9 +125,7 @@ public function renderAdmin(): void
126125 $ this ->flashMessage ('install.admin.admin_already_created ' , 'info ' );
127126 $ this ->redirect ('finish ' );
128127 }
129- } catch (TableNotFoundException $ ex ) {
130- $ this ->redirect ('default ' );
131- } catch (SettingsItemNotFoundException $ ex ) {
128+ } catch (HandlerFailedException $ ex ) {
132129 $ this ->redirect ('default ' );
133130 }
134131
@@ -185,9 +182,7 @@ public function renderFinish(): void
185182 if (! $ this ->queryBus ->handle (new SettingBoolValueQuery (Settings::ADMIN_CREATED ))) {
186183 $ this ->redirect ('default ' );
187184 }
188- } catch (TableNotFoundException $ ex ) {
189- $ this ->redirect ('default ' );
190- } catch (SettingsItemNotFoundException $ ex ) {
185+ } catch (HandlerFailedException $ ex ) {
191186 $ this ->redirect ('default ' );
192187 }
193188 }
@@ -204,9 +199,7 @@ public function renderInstalled(): void
204199 if (! $ this ->queryBus ->handle (new SettingBoolValueQuery (Settings::ADMIN_CREATED ))) {
205200 $ this ->redirect ('default ' );
206201 }
207- } catch (TableNotFoundException $ ex ) {
208- $ this ->redirect ('default ' );
209- } catch (SettingsItemNotFoundException $ ex ) {
202+ } catch (HandlerFailedException $ ex ) {
210203 $ this ->redirect ('default ' );
211204 }
212205 }
0 commit comments