From: Roland Häder Date: Thu, 16 Dec 2021 14:31:24 +0000 (+0100) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=d06cac435541022230e4bda9ad28cd75b41907a4;p=core.git Continued: - some exception messages changed (more generalized) Signed-off-by: Roland Häder --- diff --git a/framework/main/classes/criteria/search/class_SearchCriteria.php b/framework/main/classes/criteria/search/class_SearchCriteria.php index fd1e8044..43492dc3 100644 --- a/framework/main/classes/criteria/search/class_SearchCriteria.php +++ b/framework/main/classes/criteria/search/class_SearchCriteria.php @@ -140,13 +140,13 @@ class SearchCriteria extends BaseCriteria implements LocalSearchCriteria { //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('SEARCH-CRITERIA: key=%s,value[]=%s,separator=%s - CALLED!', $key, gettype($value), $separator)); if (empty($key)) { // Throw IAE - throw new InvalidArgumentException('Parameter "key" cannot be empty'); + throw new InvalidArgumentException('Parameter "key" is empty'); } elseif (is_array($value) || is_bool($value) || is_bool($value) || is_object($value) || is_resource($value)) { // Throw it again throw new InvalidArgumentException(sprintf('value[]=%s is not supported/valid', gettype($value))); } elseif (empty($separator)) { // Throw IAE - throw new InvalidArgumentException('Parameter "separator" cannot be empty'); + throw new InvalidArgumentException('Parameter "separator" is empty'); } // "Explode" value diff --git a/framework/main/classes/database/result/class_CachedDatabaseResult.php b/framework/main/classes/database/result/class_CachedDatabaseResult.php index 58ca052e..25ff9644 100644 --- a/framework/main/classes/database/result/class_CachedDatabaseResult.php +++ b/framework/main/classes/database/result/class_CachedDatabaseResult.php @@ -95,7 +95,7 @@ class CachedDatabaseResult extends BaseDatabaseResult implements SearchableResul // Misses an element? if (count($resultArray) == 0) { // Cannot be empty - throw new InvalidArgumentException('Array "resultArray" cannot be empty.'); + throw new InvalidArgumentException('Array "resultArray" is empty'); } elseif (!array_key_exists(BaseDatabaseResult::RESULT_NAME_ROWS, $resultArray)) { // Yes, then abort here throw new InvalidArgumentException(sprintf('resultArray(%d)=%s has no element "%s".', count($resultArray), print_r($resultArray, TRUE), BaseDatabaseResult::RESULT_NAME_ROWS)); diff --git a/framework/main/classes/file_directories/text/input/csv/class_CsvInputFile.php b/framework/main/classes/file_directories/text/input/csv/class_CsvInputFile.php index 81079f2e..cba62715 100644 --- a/framework/main/classes/file_directories/text/input/csv/class_CsvInputFile.php +++ b/framework/main/classes/file_directories/text/input/csv/class_CsvInputFile.php @@ -77,7 +77,7 @@ class CsvInputFile extends BaseInputTextFile implements CsvInputStreamer { /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] columnSeparator=%s,expectedMatches=%d - CALLED!', __METHOD__, __LINE__, $columnSeparator, $expectedMatches)); if (strlen($columnSeparator) === 0) { // No empty column separator - throw new InvalidArgumentException('columnSeparator cannot be empty.'); + throw new InvalidArgumentException('Parameter "columnSeparator" is empty'); } elseif ($expectedMatches < 0) { // Below zero is not valid throw new InvalidArgumentException(sprintf('expectedMatches=%d is below zero', $expectedMatches)); diff --git a/framework/main/classes/handler/tasks/class_TaskHandler.php b/framework/main/classes/handler/tasks/class_TaskHandler.php index 818ed694..a2aa58d0 100644 --- a/framework/main/classes/handler/tasks/class_TaskHandler.php +++ b/framework/main/classes/handler/tasks/class_TaskHandler.php @@ -137,10 +137,8 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask { // Get time difference from interval delay $diff = ($this->getMilliTime() - $currentTask['task_last_activity']) * 1000; - // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK-HANDLER: Task ' . $currentTask['id'] . ' diff=' . $diff . ',task_interval_delay=' . $currentTask['task_interval_delay'] . ',task_max_runs=' . $currentTask['task_max_runs'] . ',task_total_runs=' . $currentTask['task_total_runs']); - // Is the interval delay reached? + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK-HANDLER: Task ' . $currentTask['id'] . ' diff=' . $diff . ',task_interval_delay=' . $currentTask['task_interval_delay'] . ',task_max_runs=' . $currentTask['task_max_runs'] . ',task_total_runs=' . $currentTask['task_total_runs']); if ((($diff < $currentTask['task_interval_delay']) && ($currentTask['task_max_runs'] == 0)) || (($currentTask['task_max_runs'] > 0) && ($currentTask['task_total_runs'] == $currentTask['task_max_runs']))) { // Should we update the task from startup? if ($updateTask === true) { @@ -242,7 +240,7 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask { // Is the parameter valid if (empty($taskName)) { // Task name cannot be empty - throw new InvalidArgumentException('Parameter "taskName" cannot be empty.'); + throw new InvalidArgumentException('Parameter "taskName" is empty'); } // Get interval delay, startup delay and max runs