7
7
use App \Model \Acl \Repositories \RoleRepository ;
8
8
use App \Model \Acl \Role ;
9
9
use App \Model \Settings \Commands \SetSettingBoolValue ;
10
- use App \Model \Settings \Exceptions \SettingsItemNotFoundException ;
11
10
use App \Model \Settings \Queries \SettingBoolValueQuery ;
12
11
use App \Model \Settings \Settings ;
13
12
use App \Model \Structure \Repositories \SubeventRepository ;
17
16
use App \Services \QueryBus ;
18
17
use Contributte \Console \Application ;
19
18
use Doctrine \Common \Collections \ArrayCollection ;
20
- use Doctrine \DBAL \Exception \TableNotFoundException ;
21
19
use Doctrine \Migrations \Tools \Console \Command \MigrateCommand ;
22
20
use Doctrine \ORM \EntityManagerInterface ;
23
21
use Exception ;
24
22
use Nette \Application \AbortException ;
25
23
use Skautis \Skautis ;
26
24
use Skautis \Wsdl \WsdlException ;
27
25
use Symfony \Component \Console \Input \ArrayInput ;
26
+ use Symfony \Component \Messenger \Exception \HandlerFailedException ;
28
27
use Throwable ;
29
28
use Tracy \Debugger ;
30
29
use Tracy \ILogger ;
@@ -84,8 +83,8 @@ public function renderDefault(): void
84
83
85
84
$ this ->flashMessage ('install.schema.schema_already_created ' , 'info ' );
86
85
$ this ->redirect ('admin ' );
87
- } catch (TableNotFoundException $ ex ) {
88
- } catch ( SettingsItemNotFoundException $ ex ) {
86
+ } catch (HandlerFailedException $ ex ) {
87
+ // ignoruje se, tabulky ještě nejsou vytvořeny
89
88
}
90
89
}
91
90
@@ -126,9 +125,7 @@ public function renderAdmin(): void
126
125
$ this ->flashMessage ('install.admin.admin_already_created ' , 'info ' );
127
126
$ this ->redirect ('finish ' );
128
127
}
129
- } catch (TableNotFoundException $ ex ) {
130
- $ this ->redirect ('default ' );
131
- } catch (SettingsItemNotFoundException $ ex ) {
128
+ } catch (HandlerFailedException $ ex ) {
132
129
$ this ->redirect ('default ' );
133
130
}
134
131
@@ -185,9 +182,7 @@ public function renderFinish(): void
185
182
if (! $ this ->queryBus ->handle (new SettingBoolValueQuery (Settings::ADMIN_CREATED ))) {
186
183
$ this ->redirect ('default ' );
187
184
}
188
- } catch (TableNotFoundException $ ex ) {
189
- $ this ->redirect ('default ' );
190
- } catch (SettingsItemNotFoundException $ ex ) {
185
+ } catch (HandlerFailedException $ ex ) {
191
186
$ this ->redirect ('default ' );
192
187
}
193
188
}
@@ -204,9 +199,7 @@ public function renderInstalled(): void
204
199
if (! $ this ->queryBus ->handle (new SettingBoolValueQuery (Settings::ADMIN_CREATED ))) {
205
200
$ this ->redirect ('default ' );
206
201
}
207
- } catch (TableNotFoundException $ ex ) {
208
- $ this ->redirect ('default ' );
209
- } catch (SettingsItemNotFoundException $ ex ) {
202
+ } catch (HandlerFailedException $ ex ) {
210
203
$ this ->redirect ('default ' );
211
204
}
212
205
}
0 commit comments