Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authordizzy <diosmosis@users.noreply.github.com>2021-06-13 01:28:47 +0300
committerGitHub <noreply@github.com>2021-06-13 01:28:47 +0300
commit435d70e727767dba69a04889ee061d49afc04f9e (patch)
tree058d60cf76e6e6db98c0236c042cc7be6c3829b6 /core
parent7c1d7910788765e05ab4100fac475cf96b73e8f7 (diff)
Add some extra information when two non-summable columns are added together for debugging purposes. (#17664)
* Add some extra information when two non-summable columns are added together for debugging purposes. * fix copy paste
Diffstat (limited to 'core')
-rw-r--r--core/DataTable/Row.php13
1 files changed, 12 insertions, 1 deletions
diff --git a/core/DataTable/Row.php b/core/DataTable/Row.php
index cff5b24bb6..2378f319ac 100644
--- a/core/DataTable/Row.php
+++ b/core/DataTable/Row.php
@@ -643,8 +643,10 @@ class Row extends \ArrayObject
$thisColumnValue = 0;
} else if (!is_numeric($thisColumnValue)) {
$label = $this->getColumn('label');
+ $thisColumnDescription = $this->getColumnValueDescriptionForError($thisColumnValue);
+ $columnToSumValueDescription = $this->getColumnValueDescriptionForError($columnToSumValue);
throw new \Exception(sprintf('Trying to sum unsupported operands for column %s in row with label = %s: %s + %s',
- $columnName, $label, gettype($thisColumnValue), gettype($columnToSumValue)));
+ $columnName, $label, $thisColumnDescription, $columnToSumValueDescription));
}
return $thisColumnValue + $columnToSumValue;
@@ -779,4 +781,13 @@ class Row extends \ArrayObject
StaticContainer::get(LoggerInterface::class)->warning("{exception}", ['exception' => $ex]);
}
}
+
+ private function getColumnValueDescriptionForError($value)
+ {
+ $result = gettype($value);
+ if (is_array($result)) {
+ $result .= ' ' . json_encode($value);
+ }
+ return $result;
+ }
}