This commit is contained in:
as2252258@163.com
2021-04-25 01:34:05 +08:00
parent cdd28a8c43
commit 722699203a
+4 -6
View File
@@ -27,6 +27,7 @@ use Snowflake\Exception\NotFindClassException;
use stdClass;
use Swoole\Timer;
use Wchat\WchatProviders;
use function Co\run;
/**
* Class Init
@@ -135,6 +136,7 @@ class Application extends BaseApplication
*/
public function start(Input $argv): void
{
run(function () use ($argv) {
try {
/** @var Console $manager */
$manager = Snowflake::app()->get('console');
@@ -146,15 +148,11 @@ class Application extends BaseApplication
}
response()->send($manager->execCommand($class));
} catch (\Throwable $exception) {
var_export(current($exception->getTrace()));
response()->send(implode("\n", [
'Msg: ' . $exception->getMessage(),
'Line: ' . $exception->getLine(),
'File: ' . $exception->getFile()
]));
response()->send(logger()->exception($exception));
} finally {
Timer::clearAll();
}
});
}
/**