~ubuntu-branches/ubuntu/vivid/glib2.0/vivid-proposed

« back to all changes in this revision

Viewing changes to docs/reference/glib/html/glib-Error-Reporting.html

  • Committer: Package Import Robot
  • Author(s): Andreas Henriksson
  • Date: 2014-03-24 20:58:34 UTC
  • mfrom: (1.66.13)
  • Revision ID: package-import@ubuntu.com-20140324205834-8hsgok8k36ftocqa
Tags: 2.40.0-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
590
590
<li class="listitem"><p>If there's a "generic" or "unknown" error code for unrecoverable
591
591
errors it doesn't make sense to distinguish with specific codes,
592
592
it should be called &lt;NAMESPACE&gt;_&lt;MODULE&gt;_ERROR_FAILED,
593
 
for example <a class="link" href="glib-Spawning-Processes.html#G-SPAWN-ERROR-FAILED:CAPS"><code class="literal">G_SPAWN_ERROR_FAILED</code></a>.</p></li>
 
593
for example <a class="link" href="glib-Spawning-Processes.html#G-SPAWN-ERROR-FAILED:CAPS"><code class="literal">G_SPAWN_ERROR_FAILED</code></a>. In the case of error code
 
594
enumerations that may be extended in future releases, you should
 
595
generally not handle this error code explicitly, but should
 
596
instead treat any unrecognized error code as equivalent to
 
597
FAILED.</p></li>
594
598
</ul></div>
595
599
<p>Summary of rules for use of <a class="link" href="glib-Error-Reporting.html#GError" title="struct GError"><span class="type">GError</span></a>:</p>
596
600
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
862
866
otherwise. In particular, when <em class="parameter"><code>error</code></em>
863
867
 is <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>, <a class="link" href="glib-Standard-Macros.html#FALSE:CAPS" title="FALSE"><code class="literal">FALSE</code></a> will
864
868
be returned.</p>
 
869
<p>If <em class="parameter"><code>domain</code></em>
 
870
 contains a <code class="literal">FAILED</code> (or otherwise generic) error code,
 
871
you should generally not check for it explicitly, but should
 
872
instead treat any not-explicitly-recognized error code as being
 
873
equilalent to the <code class="literal">FAILED</code> code. This way, if the domain is
 
874
extended in the future to provide a more specific error code for
 
875
a certain case, your code will still work.</p>
865
876
<div class="refsect3">
866
 
<a name="id-1.4.10.7.7.5"></a><h4>Parameters</h4>
 
877
<a name="id-1.4.10.7.7.6"></a><h4>Parameters</h4>
867
878
<div class="informaltable"><table width="100%" border="0">
868
879
<colgroup>
869
880
<col width="150px" class="parameters_name">
890
901
</table></div>
891
902
</div>
892
903
<div class="refsect3">
893
 
<a name="id-1.4.10.7.7.6"></a><h4>Returns</h4>
 
904
<a name="id-1.4.10.7.7.7"></a><h4>Returns</h4>
894
905
<p> whether <em class="parameter"><code>error</code></em>
895
906
has <em class="parameter"><code>domain</code></em>
896
907
and <em class="parameter"><code>code</code></em>