@@ -174,10 +174,8 @@ protected function registerCommands()
174
174
if ($ bundle instanceof Bundle) {
175
175
try {
176
176
$ bundle ->registerCommands ($ this );
177
- } catch (\Exception $ e ) {
178
- $ this ->registrationErrors [] = $ e ;
179
177
} catch (\Throwable $ e ) {
180
- $ this ->registrationErrors [] = new FatalThrowableError ( $ e ) ;
178
+ $ this ->registrationErrors [] = $ e ;
181
179
}
182
180
}
183
181
}
@@ -192,10 +190,8 @@ protected function registerCommands()
192
190
if (!isset ($ lazyCommandIds [$ id ])) {
193
191
try {
194
192
$ this ->add ($ container ->get ($ id ));
195
- } catch (\Exception $ e ) {
196
- $ this ->registrationErrors [] = $ e ;
197
193
} catch (\Throwable $ e ) {
198
- $ this ->registrationErrors [] = new FatalThrowableError ( $ e ) ;
194
+ $ this ->registrationErrors [] = $ e ;
199
195
}
200
196
}
201
197
}
@@ -211,6 +207,10 @@ private function renderRegistrationErrors(InputInterface $input, OutputInterface
211
207
(new SymfonyStyle ($ input , $ output ))->warning ('Some commands could not be registered: ' );
212
208
213
209
foreach ($ this ->registrationErrors as $ error ) {
210
+ if (!$ error instanceof \Exception) {
211
+ $ error = new FatalThrowableError ($ error );
212
+ }
213
+
214
214
$ this ->doRenderException ($ error , $ output );
215
215
}
216
216
}
0 commit comments