public static function handleError($query = '', $queryLog = false, $errorHandler = null)
    {
        if (is_callable($errorHandler, false, $callable)) {
            return call_user_func($errorHandler, $query, $queryLog);
        }

        // save queryLog
        if ($queryLog) {
            $error = static::getConnection()->errorInfo();
            $queryLog['error'] = $error[2];
            static::finishQueryLog($queryLog);
        }

        // get error message
        $error = static::getConnection()->errorInfo();
        $message = $error[2];

        if (App::$Config['environment']=='dev') {
            $Handler = \Divergence\App::$whoops->popHandler();

            $Handler->addDataTable("Query Information", [
                'Query'     	=>	$query,
                'Error'		=>	$message,
                'ErrorCode'	=>	static::getConnection()->errorCode(),
            ]);

            \Divergence\App::$whoops->pushHandler($Handler);

            throw new \RuntimeException("Database error!");
        } else {
            throw new \RuntimeException("Database error!");
        }
    }