Continued:
authorRoland Häder <roland@mxchange.org>
Thu, 16 Dec 2021 14:31:24 +0000 (15:31 +0100)
committerRoland Häder <roland@mxchange.org>
Thu, 16 Dec 2021 14:31:24 +0000 (15:31 +0100)
- some exception messages changed (more generalized)

Signed-off-by: Roland Häder <roland@mxchange.org>
framework/main/classes/criteria/search/class_SearchCriteria.php
framework/main/classes/database/result/class_CachedDatabaseResult.php
framework/main/classes/file_directories/text/input/csv/class_CsvInputFile.php
framework/main/classes/handler/tasks/class_TaskHandler.php

index fd1e80446650f8466fe23ff9bc0b2a2c527c6fcb..43492dc3eed4901088806ee09fde6a2d12728595 100644 (file)
@@ -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
index 58ca052e472c516607ffb0b574b86ebc4d3d62e3..25ff9644b9b723e9d72eeb8080b8ec8d7b0b75b7 100644 (file)
@@ -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));
index 81079f2ecae7e1d5b6c557bfa06c535e1bbc4a98..cba6271599e55370695af8a5511097fd5ddb05fe 100644 (file)
@@ -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));
index 818ed6947e4b4d442cd233343d791b4092c5cdcf..a2aa58d051e085631338d36a2161f7487762cc87 100644 (file)
@@ -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