1
0
mirror of https://github.com/php/doc-es.git synced 2026-04-29 18:13:18 +02:00
Files
archived-doc-es/reference/mongo/mongoprotocolexception.xml
T
Pedro Antonio Gil Rodríguez 6989bcb362 Actualización a la última versión
git-svn-id: https://svn.php.net/repository/phpdoc/es/trunk@333956 c90b9560-bf6c-de11-be94-00142212c4b1
2014-06-26 10:14:35 +00:00

109 lines
3.2 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: d5a500831e9e6e708b64b337d70edb50f6e6989a Maintainer: seros Status: ready -->
<!-- Reviewed: no -->
<phpdoc:classref xml:id="class.mongoprotocolexception" xmlns:phpdoc="http://php.net/ns/phpdoc" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
<title>La clase MongoProtocolException</title>
<titleabbrev>MongoProtocolException</titleabbrev>
<partintro>
<!-- {{{ MongoProtocolException intro -->
<section xml:id="mongoprotocolexception.intro">
&reftitle.intro;
<para>
Al conversar con MongoDB 2.6.0, y posterior, ciertas operaciones (como las escrituras) pueden lanzar una MongoProtocolException cuando la respuesta
del servidor no tiene sentido - por ejemplo durante un fallo de red (podríamos leer la respuesta completa) o corrupción de datos.
</para>
<para>
Esta excepción también es lanzada al intentar conversar con protocolos más recientes de los que soporta el servidor, por ejemplo, usando
<classname>MongoWriteBatch</classname> al conversar con un servidor de MongoDB anterior a la versión 2.6.0.
</para>
</section>
<!-- }}} -->
<section xml:id="mongoprotocolexception.synopsis">
&reftitle.classsynopsis;
<!-- {{{ Synopsis -->
<classsynopsis>
<ooclass><classname>MongoProtocolException</classname></ooclass>
<!-- {{{ Class synopsis -->
<classsynopsisinfo>
<ooclass>
<classname>MongoProtocolException</classname>
</ooclass>
<ooclass>
<modifier>extends</modifier>
<classname>MongoException</classname>
</ooclass>
</classsynopsisinfo>
<!-- }}} -->
<classsynopsisinfo role="comment">&InheritedProperties;</classsynopsisinfo>
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('exception.synopsis')/descendant::db:fieldsynopsis)" />
</classsynopsis>
<!-- }}} -->
</section>
<section xml:id="mongoprotocolexception.examples">
&reftitle.examples;
<example xml:id="mongoprotocolexception.example.catch">
<title>Capturar una MongoProtocolException</title>
<para>
Ejecutar el siguiente ejemplo con MongoDB anterior a 2.6.0 lanzará una MongoProtocolException
</para>
<programlisting role="php">
<![CDATA[
<?php
$mc = new MongoClient("localhost");
$c = $mc->selectCollection("test", "test");
try {
$batch = new MongoInsertBatch($c);
} catch(MongoProtocolException $e) {
echo $e->getMessage();
}
?>
]]>
</programlisting>
&examples.outputs.similar;
<screen>
<![CDATA[
Current primary does not have a Write API
]]>
</screen>
</example>
</section>
</partintro>
</phpdoc:classref>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->