protected function assertResult($descriptor, $result)
    {
        $errors = array(
            401 => "InvalidCredentials",
            402 => "PaymentRequired",
            403 => "Forbidden",
            404 => "NotFound",
            405 => "InvalidMethod",
            406 => "NotAcceptable",
            415 => "InvalidMedia",
            429 => "RateLimited",
            500 => "ServerError",
            400 => "ClientError"
        );
        if (isset($errors[$result->code])) {
            $class = $errors[$result->code];
            $class = "PortaText\\Exception\\$class";
            throw new $class($descriptor, $result);
        }
    }