<!-- ##### SECTION Title ##### -->
GError

<!-- ##### SECTION Short_Description ##### -->

error reporting.

<!-- ##### SECTION Long_Description ##### -->
<para>
The #GError object is used to report errors that occur in MateConf
library routines. All functions that report errors work the same way:
<itemizedlist>
<listitem>
<para>
The last argument to the function is a #GError**, a pointer to a
location where a #GError* can be placed.
</para>
</listitem>
<listitem>
<para>
This last argument may be <symbol>NULL</symbol>, in which case no
error will be returned.
</para>
</listitem>
<listitem>
<para>
If non-<symbol>NULL</symbol>, the argument should be the address of a 
#GError* variable, which should be initialized to
<symbol>NULL</symbol>. 
</para>
</listitem>
<listitem>
<para>
If an error occurs, a #GError will be allocated and placed in the
return location; the caller must free the #GError with
g_error_free(). If no error occurs, the return location will be
left untouched. That is, the test <literal>error != NULL</literal> 
should always be a reliable indicator of whether the operation failed.
</para>
</listitem>
</itemizedlist>
</para>

<para>
It's also common that the return value of a function indicates whether
or not an error occurred. Typically, <symbol>TRUE</symbol> is returned
on success. In some cases, a <symbol>NULL</symbol> return value
indicates failure. Either way, if the return value indicates failure
and you passed a non-<symbol>NULL</symbol> value for the last argument
to the function, a #GError will be returned. If the return value
indicates success, then a #GError will never be returned.  These
relationships are guaranteed; that is, you can reliably use the return
value to decide whether a #GError was placed in the return
location. If a function does <emphasis>not</emphasis> indicate
success/failure by return value, you must check whether the
#GError is <symbol>NULL</symbol> to detect errors.
</para>

<para>
Here's a short error handling example:
<programlisting>
  GError* err = NULL;

  if (!mateconf_init(&amp;err))
    {
      fprintf(stderr, _("Failed to init MateConf: %s\n"), err->message);
      g_error_free(err); 
      err = NULL;
    }
</programlisting>
</para>

<!-- ##### SECTION See_Also ##### -->
<para>

</para>

<!-- ##### SECTION Stability_Level ##### -->


<!-- ##### SECTION Image ##### -->


<!-- ##### ENUM MateConfError ##### -->
<para>
The #MateConfError enumeration allows client applications to
differentiate between different kinds of error. You may wish to take
specific actions depending on the error type.
</para>

@MATECONF_ERROR_SUCCESS: indicates that no error occurred, won't be returned in a #GError.
@MATECONF_ERROR_FAILED: indicates failure, but no more specific #MateConfError applied.
@MATECONF_ERROR_NO_SERVER: indicates that the MateConf server couldn't be contacted, probably a CORBA problem.
@MATECONF_ERROR_NO_PERMISSION: indicates that permission to access some resource was denied.
@MATECONF_ERROR_BAD_ADDRESS: indicates that a configuration source address was syntactically invalid or impossible to resolve.
@MATECONF_ERROR_BAD_KEY: indicates that a key was malformed.
@MATECONF_ERROR_PARSE_ERROR: indicates that some parsing was done (perhaps in a backend) and it failed.
@MATECONF_ERROR_CORRUPT: indicates that some part of the database is corrupt.
@MATECONF_ERROR_TYPE_MISMATCH: indicates that a specific type was required, and another type was found.
@MATECONF_ERROR_IS_DIR: indicates that an operation only applicable to keys was performed on a directory.
@MATECONF_ERROR_IS_KEY: indicates that an operation only applicable to directories was performed on a key.
@MATECONF_ERROR_OVERRIDDEN: indicates that the administrator has imposed a mandatory value, and it could not be changed.
@MATECONF_ERROR_OAF_ERROR: 
@MATECONF_ERROR_LOCAL_ENGINE: 
@MATECONF_ERROR_LOCK_FAILED: 
@MATECONF_ERROR_NO_WRITABLE_DATABASE: 
@MATECONF_ERROR_IN_SHUTDOWN: 

<!-- ##### FUNCTION mateconf_error_new ##### -->
<para>
Creates a new error. Normally the MateConf library does this, but you
might find a reason to do it as well. @en is the error number, @format
is a printf()-style format for the error message, and the variable
argument list is the same as in printf(). 
</para>

@en: the error number.
@format: printf()-style format for error description.
@Varargs: arguments required by the @format.
@Returns: newly-allocated #GError.


<!-- ##### FUNCTION mateconf_error_quark ##### -->
<para>
Converts the string 'mateconf-error-quark' to a #GQuark and returns the value.
</para>

@void: 
@Returns: the #GQuark representing the string.


<!-- ##### FUNCTION mateconf_set_error ##### -->
<para>
Internal function.
</para>

@err: 
@en: 
@format: 
@Varargs: 


<!-- ##### FUNCTION mateconf_compose_errors ##### -->
<para>
Internal function.
</para>

@err1: 
@err2: 
@Returns: 


