From 441d70e1889abec4fbe390258b9cc0a847e0c70c Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Mon, 22 Sep 2014 22:00:51 +0200 Subject: set error handler and throw exceptions on error case --- appinfo/application.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'appinfo') 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(); -- cgit v1.2.3