Use finally to restore error handler after command runs
parent
99fa6116f9
commit
711f436b24
|
@ -338,8 +338,6 @@ class Application extends BaseApplication
|
||||||
$io->writeError('<info>Memory usage: '.round(memory_get_usage() / 1024 / 1024, 2).'MiB (peak: '.round(memory_get_peak_usage() / 1024 / 1024, 2).'MiB), time: '.round(microtime(true) - $startTime, 2).'s');
|
$io->writeError('<info>Memory usage: '.round(memory_get_usage() / 1024 / 1024, 2).'MiB (peak: '.round(memory_get_peak_usage() / 1024 / 1024, 2).'MiB), time: '.round(microtime(true) - $startTime, 2).'s');
|
||||||
}
|
}
|
||||||
|
|
||||||
restore_error_handler();
|
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
} catch (ScriptExecutionException $e) {
|
} catch (ScriptExecutionException $e) {
|
||||||
return (int) $e->getCode();
|
return (int) $e->getCode();
|
||||||
|
@ -349,9 +347,9 @@ class Application extends BaseApplication
|
||||||
|
|
||||||
$this->hintCommonErrors($e);
|
$this->hintCommonErrors($e);
|
||||||
|
|
||||||
restore_error_handler();
|
|
||||||
|
|
||||||
throw $e;
|
throw $e;
|
||||||
|
} finally {
|
||||||
|
restore_error_handler();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue