exceptions.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  1. <!DOCTYPE html>
  2. <!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
  3. <!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
  4. <head>
  5. <meta charset="utf-8">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <title>grpc.framework.face.exceptions &mdash; grpcio 0.10.0a0 documentation</title>
  8. <link rel="stylesheet" href="../../../../_static/css/theme.css" type="text/css" />
  9. <link rel="top" title="grpcio 0.10.0a0 documentation" href="../../../../index.html"/>
  10. <link rel="up" title="Module code" href="../../../index.html"/>
  11. <script src="_static/js/modernizr.min.js"></script>
  12. </head>
  13. <body class="wy-body-for-nav" role="document">
  14. <div class="wy-grid-for-nav">
  15. <nav data-toggle="wy-nav-shift" class="wy-nav-side">
  16. <div class="wy-side-nav-search">
  17. <a href="../../../../index.html" class="icon icon-home"> grpcio
  18. </a>
  19. <div role="search">
  20. <form id="rtd-search-form" class="wy-form" action="../../../../search.html" method="get">
  21. <input type="text" name="q" placeholder="Search docs" />
  22. <input type="hidden" name="check_keywords" value="yes" />
  23. <input type="hidden" name="area" value="default" />
  24. </form>
  25. </div>
  26. </div>
  27. <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
  28. <ul>
  29. <li class="toctree-l1"><a class="reference internal" href="../../../../grpc.html">grpc package</a><ul>
  30. <li class="toctree-l2"><a class="reference internal" href="../../../../grpc.html#subpackages">Subpackages</a><ul>
  31. <li class="toctree-l3"><a class="reference internal" href="../../../../grpc.early_adopter.html">grpc.early_adopter package</a><ul>
  32. <li class="toctree-l4"><a class="reference internal" href="../../../../grpc.early_adopter.html#submodules">Submodules</a></li>
  33. <li class="toctree-l4"><a class="reference internal" href="../../../../grpc.early_adopter.html#module-grpc.early_adopter.implementations">grpc.early_adopter.implementations module</a></li>
  34. <li class="toctree-l4"><a class="reference internal" href="../../../../grpc.early_adopter.html#module-grpc.early_adopter.implementations_test">grpc.early_adopter.implementations_test module</a></li>
  35. <li class="toctree-l4"><a class="reference internal" href="../../../../grpc.early_adopter.html#module-grpc.early_adopter">Module contents</a></li>
  36. </ul>
  37. </li>
  38. <li class="toctree-l3"><a class="reference internal" href="../../../../grpc.framework.html">grpc.framework package</a><ul>
  39. <li class="toctree-l4"><a class="reference internal" href="../../../../grpc.framework.html#subpackages">Subpackages</a></li>
  40. <li class="toctree-l4"><a class="reference internal" href="../../../../grpc.framework.html#module-grpc.framework">Module contents</a></li>
  41. </ul>
  42. </li>
  43. </ul>
  44. </li>
  45. <li class="toctree-l2"><a class="reference internal" href="../../../../grpc.html#module-grpc">Module contents</a></li>
  46. </ul>
  47. </li>
  48. </ul>
  49. </div>
  50. &nbsp;
  51. </nav>
  52. <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
  53. <nav class="wy-nav-top" role="navigation" aria-label="top navigation">
  54. <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
  55. <a href="../../../../index.html">grpcio</a>
  56. </nav>
  57. <div class="wy-nav-content">
  58. <div class="rst-content">
  59. <div role="navigation" aria-label="breadcrumbs navigation">
  60. <ul class="wy-breadcrumbs">
  61. <li><a href="../../../../index.html">Docs</a> &raquo;</li>
  62. <li><a href="../../../index.html">Module code</a> &raquo;</li>
  63. <li>grpc.framework.face.exceptions</li>
  64. <li class="wy-breadcrumbs-aside">
  65. </li>
  66. </ul>
  67. <hr/>
  68. </div>
  69. <div role="main" class="document">
  70. <h1>Source code for grpc.framework.face.exceptions</h1><div class="highlight"><pre>
  71. <span class="c"># Copyright 2015, Google Inc.</span>
  72. <span class="c"># All rights reserved.</span>
  73. <span class="c">#</span>
  74. <span class="c"># Redistribution and use in source and binary forms, with or without</span>
  75. <span class="c"># modification, are permitted provided that the following conditions are</span>
  76. <span class="c"># met:</span>
  77. <span class="c">#</span>
  78. <span class="c"># * Redistributions of source code must retain the above copyright</span>
  79. <span class="c"># notice, this list of conditions and the following disclaimer.</span>
  80. <span class="c"># * Redistributions in binary form must reproduce the above</span>
  81. <span class="c"># copyright notice, this list of conditions and the following disclaimer</span>
  82. <span class="c"># in the documentation and/or other materials provided with the</span>
  83. <span class="c"># distribution.</span>
  84. <span class="c"># * Neither the name of Google Inc. nor the names of its</span>
  85. <span class="c"># contributors may be used to endorse or promote products derived from</span>
  86. <span class="c"># this software without specific prior written permission.</span>
  87. <span class="c">#</span>
  88. <span class="c"># THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS</span>
  89. <span class="c"># &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT</span>
  90. <span class="c"># LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR</span>
  91. <span class="c"># A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT</span>
  92. <span class="c"># OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,</span>
  93. <span class="c"># SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT</span>
  94. <span class="c"># LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,</span>
  95. <span class="c"># DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY</span>
  96. <span class="c"># THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT</span>
  97. <span class="c"># (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE</span>
  98. <span class="c"># OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span>
  99. <span class="sd">&quot;&quot;&quot;Exceptions used in the Face layer of RPC Framework.&quot;&quot;&quot;</span>
  100. <span class="kn">import</span> <span class="nn">abc</span>
  101. <div class="viewcode-block" id="NoSuchMethodError"><a class="viewcode-back" href="../../../../grpc.framework.face.html#grpc.framework.face.exceptions.NoSuchMethodError">[docs]</a><span class="k">class</span> <span class="nc">NoSuchMethodError</span><span class="p">(</span><span class="ne">Exception</span><span class="p">):</span>
  102. <span class="sd">&quot;&quot;&quot;Raised by customer code to indicate an unrecognized RPC method name.</span>
  103. <span class="sd"> Attributes:</span>
  104. <span class="sd"> name: The unrecognized name.</span>
  105. <span class="sd"> &quot;&quot;&quot;</span>
  106. <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">name</span><span class="p">):</span>
  107. <span class="sd">&quot;&quot;&quot;Constructor.</span>
  108. <span class="sd"> Args:</span>
  109. <span class="sd"> name: The unrecognized RPC method name.</span>
  110. <span class="sd"> &quot;&quot;&quot;</span>
  111. <span class="nb">super</span><span class="p">(</span><span class="n">NoSuchMethodError</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="n">__init__</span><span class="p">()</span>
  112. <span class="bp">self</span><span class="o">.</span><span class="n">name</span> <span class="o">=</span> <span class="n">name</span>
  113. </div>
  114. <div class="viewcode-block" id="RpcError"><a class="viewcode-back" href="../../../../grpc.framework.face.html#grpc.framework.face.exceptions.RpcError">[docs]</a><span class="k">class</span> <span class="nc">RpcError</span><span class="p">(</span><span class="ne">Exception</span><span class="p">):</span>
  115. <span class="sd">&quot;&quot;&quot;Common super type for all exceptions raised by the Face layer.</span>
  116. <span class="sd"> Only RPC Framework should instantiate and raise these exceptions.</span>
  117. <span class="sd"> &quot;&quot;&quot;</span>
  118. <span class="n">__metaclass__</span> <span class="o">=</span> <span class="n">abc</span><span class="o">.</span><span class="n">ABCMeta</span>
  119. </div>
  120. <div class="viewcode-block" id="CancellationError"><a class="viewcode-back" href="../../../../grpc.framework.face.html#grpc.framework.face.exceptions.CancellationError">[docs]</a><span class="k">class</span> <span class="nc">CancellationError</span><span class="p">(</span><span class="n">RpcError</span><span class="p">):</span>
  121. <span class="sd">&quot;&quot;&quot;Indicates that an RPC has been cancelled.&quot;&quot;&quot;</span>
  122. </div>
  123. <div class="viewcode-block" id="ExpirationError"><a class="viewcode-back" href="../../../../grpc.framework.face.html#grpc.framework.face.exceptions.ExpirationError">[docs]</a><span class="k">class</span> <span class="nc">ExpirationError</span><span class="p">(</span><span class="n">RpcError</span><span class="p">):</span>
  124. <span class="sd">&quot;&quot;&quot;Indicates that an RPC has expired (&quot;timed out&quot;).&quot;&quot;&quot;</span>
  125. </div>
  126. <div class="viewcode-block" id="NetworkError"><a class="viewcode-back" href="../../../../grpc.framework.face.html#grpc.framework.face.exceptions.NetworkError">[docs]</a><span class="k">class</span> <span class="nc">NetworkError</span><span class="p">(</span><span class="n">RpcError</span><span class="p">):</span>
  127. <span class="sd">&quot;&quot;&quot;Indicates that some error occurred on the network.&quot;&quot;&quot;</span>
  128. </div>
  129. <div class="viewcode-block" id="ServicedError"><a class="viewcode-back" href="../../../../grpc.framework.face.html#grpc.framework.face.exceptions.ServicedError">[docs]</a><span class="k">class</span> <span class="nc">ServicedError</span><span class="p">(</span><span class="n">RpcError</span><span class="p">):</span>
  130. <span class="sd">&quot;&quot;&quot;Indicates that the Serviced failed in the course of an RPC.&quot;&quot;&quot;</span>
  131. </div>
  132. <div class="viewcode-block" id="ServicerError"><a class="viewcode-back" href="../../../../grpc.framework.face.html#grpc.framework.face.exceptions.ServicerError">[docs]</a><span class="k">class</span> <span class="nc">ServicerError</span><span class="p">(</span><span class="n">RpcError</span><span class="p">):</span>
  133. <span class="sd">&quot;&quot;&quot;Indicates that the Servicer failed in the course of servicing an RPC.&quot;&quot;&quot;</span></div>
  134. </pre></div>
  135. </div>
  136. <footer>
  137. <hr/>
  138. <div role="contentinfo">
  139. <p>
  140. &copy; Copyright 2015, Author.
  141. </p>
  142. </div>
  143. Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
  144. </footer>
  145. </div>
  146. </div>
  147. </section>
  148. </div>
  149. <script type="text/javascript">
  150. var DOCUMENTATION_OPTIONS = {
  151. URL_ROOT:'../../../../',
  152. VERSION:'0.10.0a0',
  153. COLLAPSE_INDEX:false,
  154. FILE_SUFFIX:'.html',
  155. HAS_SOURCE: true
  156. };
  157. </script>
  158. <script type="text/javascript" src="../../../../_static/jquery.js"></script>
  159. <script type="text/javascript" src="../../../../_static/underscore.js"></script>
  160. <script type="text/javascript" src="../../../../_static/doctools.js"></script>
  161. <script type="text/javascript" src="../../../../_static/js/theme.js"></script>
  162. <script type="text/javascript">
  163. jQuery(function () {
  164. SphinxRtdTheme.StickyNav.enable();
  165. });
  166. </script>
  167. </body>
  168. </html>