From 5bf5014b60d2076175e1ff4e1edeeef5023c5fdb Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Mon, 5 Jan 2015 00:16:47 +0100 Subject: [PATCH] Added Async Task crash warning --- src/pocketmine/scheduler/AsyncPool.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/pocketmine/scheduler/AsyncPool.php b/src/pocketmine/scheduler/AsyncPool.php index 15987d5ce..1fdc19815 100644 --- a/src/pocketmine/scheduler/AsyncPool.php +++ b/src/pocketmine/scheduler/AsyncPool.php @@ -103,6 +103,11 @@ class AsyncPool{ $this->workerUsage[$this->taskWorkers[$task->getTaskId()]]--; unset($this->tasks[$task->getTaskId()]); unset($this->taskWorkers[$task->getTaskId()]); + }elseif($task->isTerminated()){ + $info = $task->getTerminationInfo(); + $this->removeTask($task); + $this->server->getLogger()->critical("Could not execute asynchronous task " . (new \ReflectionClass($task))->getShortName() . ": " . $info["message"]); + $this->server->getLogger()->critical("On ".$info["scope"].", line ".$info["line"] .", ".$info["function"]."()"); } } }