summaryrefslogtreecommitdiffstats
path: root/appinfo/application.php
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2014-09-22 22:00:51 +0200
committerBernhard Posselt <dev@bernhard-posselt.com>2014-09-22 22:00:51 +0200
commit441d70e1889abec4fbe390258b9cc0a847e0c70c (patch)
tree2af35dc438568381de50f26cd3f9c75edeb80898 /appinfo/application.php
parent813f24b942c19560ff3964e73541ab4fba0567d8 (diff)
set error handler and throw exceptions on error case
Diffstat (limited to 'appinfo/application.php')
-rw-r--r--appinfo/application.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/appinfo/application.php b/appinfo/application.php
index 2dea28fc2..4c99583e6 100644
--- a/appinfo/application.php
+++ b/appinfo/application.php
@@ -67,6 +67,14 @@ class Application extends App {
public function __construct(array $urlParams=array()){
parent::__construct('news', $urlParams);
+ // Turn all errors into exceptions to combat shitty library behavior
+ set_error_handler(function ($code, $message) {
+ if ($code === E_ERROR || $code === E_USER_ERROR) {
+ throw new \Exception($message, $code);
+ }
+ });
+
+
$container = $this->getContainer();