From 65d71c352656feafdf4e326d5671b0fb5e09fa88 Mon Sep 17 00:00:00 2001 From: Aaron Piotrowski Date: Fri, 4 Jan 2019 16:46:53 -0600 Subject: [PATCH] Check for resolution of promise in process-runner.php --- lib/Context/Internal/process-runner.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/Context/Internal/process-runner.php b/lib/Context/Internal/process-runner.php index d1693b4..00b951e 100644 --- a/lib/Context/Internal/process-runner.php +++ b/lib/Context/Internal/process-runner.php @@ -33,7 +33,7 @@ if (\function_exists("cli_set_process_title")) { require $autoloadPath; })(); -Loop::run(function () use ($argc, $argv) { +Loop::run(function () use (&$result, $argc, $argv) { // Remove this scripts path from process arguments. --$argc; \array_shift($argv); @@ -106,3 +106,8 @@ Loop::run(function () use ($argc, $argv) { exit(1); } }); + +if ($result === null) { + \trigger_error("The script did not resolve the promise returned from the callable function", E_USER_ERROR); + exit(1); +}