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 stdClass;
use Swoole\Timer; use Swoole\Timer;
use Wchat\WchatProviders; use Wchat\WchatProviders;
use function Co\run;
/** /**
* Class Init * Class Init
@@ -135,6 +136,7 @@ class Application extends BaseApplication
*/ */
public function start(Input $argv): void public function start(Input $argv): void
{ {
run(function () use ($argv) {
try { try {
/** @var Console $manager */ /** @var Console $manager */
$manager = Snowflake::app()->get('console'); $manager = Snowflake::app()->get('console');
@@ -146,15 +148,11 @@ class Application extends BaseApplication
} }
response()->send($manager->execCommand($class)); response()->send($manager->execCommand($class));
} catch (\Throwable $exception) { } catch (\Throwable $exception) {
var_export(current($exception->getTrace())); response()->send(logger()->exception($exception));
response()->send(implode("\n", [
'Msg: ' . $exception->getMessage(),
'Line: ' . $exception->getLine(),
'File: ' . $exception->getFile()
]));
} finally { } finally {
Timer::clearAll(); Timer::clearAll();
} }
});
} }
/** /**