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
diff options
context:
space:
mode:
authordiosmosis <benaka@piwik.pro>2015-05-23 00:19:27 +0300
committerdiosmosis <benaka@piwik.pro>2015-05-25 01:22:19 +0300
commit80a0463fa9a905c2a552cd64c6e097c2581ea25d (patch)
tree3dbdd39b2f58b3a45fec39215773c47a8a1a6cd7 /core/Container
parent5fe7ae348a7c18b170251965a0a9ac1e6fbae3bf (diff)
In ExceptionHandler::getErrorResponse(), ignore case where event posting fails because the environment has not been created yet. Fixes EnvironmentValidationTest. Includes new exception thrown when StaticContainer cannot find an existing container.
Diffstat (limited to 'core/Container')
-rw-r--r--core/Container/ContainerDoesNotExistException.php18
-rw-r--r--core/Container/StaticContainer.php2
2 files changed, 19 insertions, 1 deletions
diff --git a/core/Container/ContainerDoesNotExistException.php b/core/Container/ContainerDoesNotExistException.php
new file mode 100644
index 0000000000..9577d51624
--- /dev/null
+++ b/core/Container/ContainerDoesNotExistException.php
@@ -0,0 +1,18 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+namespace Piwik\Container;
+
+use RuntimeException;
+
+/**
+ * Thrown if the root container has not been created and set in StaticContainer.
+ */
+class ContainerDoesNotExistException extends RuntimeException
+{
+} \ No newline at end of file
diff --git a/core/Container/StaticContainer.php b/core/Container/StaticContainer.php
index 09fd5f552e..fca87c04b7 100644
--- a/core/Container/StaticContainer.php
+++ b/core/Container/StaticContainer.php
@@ -37,7 +37,7 @@ class StaticContainer
public static function getContainer()
{
if (self::$container === null) {
- throw new \Exception("The root container has not been created yet.");
+ throw new ContainerDoesNotExistException("The root container has not been created yet.");
}
return self::$container;