public function AllErrorToException(){

        if(!class_exists('\\Middlewares\\Whoops'))
            return ;

        set_error_handler(function($severity, $message, $file, $line){
            if (!(error_reporting() & $severity)) {
                // This error code is not included in error_reporting
                return;
            }
            throw new \ErrorException($message, 0, $severity, $file, $line);
        });
    }