### Function

# Gio DBusError encode_gerror

since: 2.26

#### Declaration [src]

    gchar*
    g_dbus_error_encode_gerror (
      const GError* error
    )

#### Description [src]

Creates a D-Bus error name to use for `error`.

If `error` matches a registered error (see `g_dbus_error_register_error()`), the corresponding D-Bus error name will be returned.

Otherwise the a name of the form `org.gtk.GDBus.UnmappedGError.Quark._ESCAPED_QUARK_NAME.Code_ERROR_CODE` will be used. This allows other GDBus applications to map the error on the wire back to a `GError` using `g_dbus_error_new_for_dbus_error()`.

This function is typically only used in object mappings to put a `GError` on the wire. Regular applications should not use it.

Available since: 2.26

#### Parameters

`error`

  Type: `GError`

  An error.

  The data is owned by the caller of the function.

#### Return value

Type: `gchar*`

A D-Bus error name.

The caller of the function takes ownership of the data, and is responsible for freeing it.
The value is a NUL terminated UTF-8 string.