Skip to content

Commit 4befa90

Browse files
committed
fix: cannot catch error before run
1 parent 9cb6520 commit 4befa90

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/AbstractApplication.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ public function __construct(array $config = [], Input $input = null, Output $out
116116
}
117117

118118
/**
119-
*
120119
* @throws \InvalidArgumentException
121120
*/
122121
protected function init()
@@ -128,6 +127,10 @@ protected function init()
128127
'endMemory' => 0,
129128
];
130129

130+
if (!$this->errorHandler) {
131+
$this->errorHandler = new ErrorHandler();
132+
}
133+
131134
$this->registerErrorHandle();
132135
}
133136

@@ -159,10 +162,6 @@ protected function prepareRun()
159162
Style::setNoColor();
160163
}
161164

162-
if (!$this->errorHandler) {
163-
$this->errorHandler = new ErrorHandler();
164-
}
165-
166165
// date_default_timezone_set($this->config('timeZone', 'UTC'));
167166
// new AutoCompletion(array_merge($this->getCommandNames(), $this->getControllerNames()));
168167
}

0 commit comments

Comments
 (0)