1
0
mirror of https://github.com/danog/parallel.git synced 2024-11-26 20:34:40 +01:00

Check for resolution of promise in process-runner.php

This commit is contained in:
Aaron Piotrowski 2019-01-04 16:46:53 -06:00
parent ccf285bdcc
commit 65d71c3526
No known key found for this signature in database
GPG Key ID: ADD1EF783EDE9EEB

View File

@ -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);
}