config = \Phacil\Framework\Registry::getInstance(\Phacil\Framework\Config::class); parent::__construct((is_array($message) ? \Phacil\Framework\Json::encode($message) : $message), $code, $previous); } public function __destruct() { if($this->config->get('config_registry_webexceptions')) parent::__destruct(); } }