diff options
author | Thomas Steur <tsteur@users.noreply.github.com> | 2020-09-11 02:01:16 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-11 02:01:16 +0300 |
commit | 748ac97ed42afc3df929af4f83de4384105d21b3 (patch) | |
tree | 3933c66516bf4e6e595f4a9b3ff1ae5114b2cd67 /core | |
parent | 695f7c80a105ecb928af9e458d89fe3751552434 (diff) |
Add more debug information for some specific archiving errors (#16387)
Diffstat (limited to 'core')
-rw-r--r-- | core/Archive/DataTableFactory.php | 3 | ||||
-rw-r--r-- | core/ArchiveProcessor/PluginsArchiver.php | 2 | ||||
-rw-r--r-- | core/DataTable.php | 6 |
3 files changed, 8 insertions, 3 deletions
diff --git a/core/Archive/DataTableFactory.php b/core/Archive/DataTableFactory.php index ec8ba337fd..5aac24c521 100644 --- a/core/Archive/DataTableFactory.php +++ b/core/Archive/DataTableFactory.php @@ -11,6 +11,7 @@ namespace Piwik\Archive; use Piwik\DataTable; use Piwik\DataTable\Row; +use Piwik\Period; use Piwik\Segment; use Piwik\Site; @@ -114,7 +115,7 @@ class DataTableFactory */ public static function getSiteIdFromMetadata(DataTable $table) { - $site = $table->getMetadata('site'); + $site = $table->getMetadata(self::TABLE_METADATA_SITE_INDEX); if (empty($site)) { return null; } else { diff --git a/core/ArchiveProcessor/PluginsArchiver.php b/core/ArchiveProcessor/PluginsArchiver.php index 4fd517a1df..3911ff533d 100644 --- a/core/ArchiveProcessor/PluginsArchiver.php +++ b/core/ArchiveProcessor/PluginsArchiver.php @@ -180,7 +180,7 @@ class PluginsArchiver $this->params->getSegment() ? sprintf("(for segment = '%s')", $this->params->getSegment()->getString()) : '' ); } catch (Exception $e) { - throw new PluginsArchiverException($e->getMessage() . " - in plugin $pluginName", $e->getCode(), $e); + throw new PluginsArchiverException($e->getMessage() . " - in plugin $pluginName with trace: " . $e->getTraceAsString(), $e->getCode(), $e); } finally { self::$currentPluginBeingArchived = null; } diff --git a/core/DataTable.php b/core/DataTable.php index 29b93e1bd1..2cf90b03ec 100644 --- a/core/DataTable.php +++ b/core/DataTable.php @@ -11,6 +11,7 @@ namespace Piwik; use Closure; use Exception; +use Piwik\Archive\DataTableFactory; use Piwik\DataTable\DataTableInterface; use Piwik\DataTable\Manager; use Piwik\DataTable\Renderer\Html; @@ -1894,7 +1895,10 @@ class DataTable implements DataTableInterface, \IteratorAggregate, \ArrayAccess { $labelToLookFor = $row->getColumn('label'); if ($labelToLookFor === false) { - throw new Exception("Label column not found in the table to add in addDataTable()"); + $message = sprintf("Label column not found in the table to add in addDataTable(). Row: %s", + var_export($row->getColumns(), 1) + ); + throw new Exception($message); } $rowFound = $this->getRowFromLabel($labelToLookFor); if ($rowFound === false) { |