private function curlException($message, $code) {
        if (!array_key_exists($code, $this->getExceptionCodeMappings())) throw new CurlExceptions\CurlException("Error: {$message} and the Error no is: {$code} ", $code);

        $exceptionClass = $this->exceptionsNamespace . '\\' . $this->getExceptionCodeMappings()[$code];
        if (!class_exists($exceptionClass)) throw new \RuntimeException(
            $exceptionClass . ' does not exist. Check class var $exceptionCodeMappings in Circle\RestClientBundle\Traits\Exceptions.'
        );
        throw new $exceptionClass($message, $code);

    }