Clearer error message
This commit is contained in:
parent
57a987874d
commit
5ecb8fe9f3
1 changed files with 2 additions and 1 deletions
|
|
@ -16,12 +16,13 @@ $environment = array_merge($_SERVER, $_ENV);
|
||||||
ksort($environment);
|
ksort($environment);
|
||||||
|
|
||||||
$threads = $args['threads'] ?? $environment['THREADS'] ?? (int) shell_exec("grep -c processor /proc/cpuinfo");
|
$threads = $args['threads'] ?? $environment['THREADS'] ?? (int) shell_exec("grep -c processor /proc/cpuinfo");
|
||||||
|
|
||||||
if(class_exists($args['worker'])){
|
if(class_exists($args['worker'])){
|
||||||
$workerClass = $args['worker'];
|
$workerClass = $args['worker'];
|
||||||
} else {
|
} else {
|
||||||
$workerFile = __DIR__ . "/../../../../src/Workers/{$args['worker']}.php";
|
$workerFile = __DIR__ . "/../../../../src/Workers/{$args['worker']}.php";
|
||||||
if (!file_exists($workerFile)) {
|
if (!file_exists($workerFile)) {
|
||||||
throw new BenzineException(sprintf("No such worker as \"%s\"", realpath($workerFile)));
|
throw new BenzineException(sprintf("No such worker as \"%s\", no such class as \"%s\"", realpath($workerFile), $args['worker']));
|
||||||
}
|
}
|
||||||
require_once($workerFile);
|
require_once($workerFile);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue