### Function

# GLib Variant parse_error_print_context

since: 2.40

#### Declaration [src]

    gchar*
    g_variant_parse_error_print_context (
      GError* error,
      const gchar* source_str
    )

#### Description [src]

Pretty-prints a message showing the context of a `GVariant` parse error within the string for which parsing was attempted.

The resulting string is suitable for output to the console or other monospace media where newlines are treated in the usual way.

The message will typically look something like one of the following:

    unterminated string constant:
      (1, 2, 3, 'abc
                ^^^^

or

    unable to find a common type:
      [1, 2, 3, 'str']
       ^        ^^^^^

The format of the message may change in a future version.

`error` must have come from a failed attempt to `g_variant_parse()` and `source_str` must be exactly the same string that caused the error. If `source_str` was not nul-terminated when you passed it to `g_variant_parse()` then you must add nul termination before using this function.

Available since: 2.40

#### Parameters

`error`

  Type: `GError`

  A `GError` from the `GVariantParseError` domain.

  The data is owned by the caller of the function.

`source_str`

  Type: `const gchar*`

  The string that was given to the parser.

  The data is owned by the caller of the function.
  The value is a NUL terminated UTF-8 string.

#### Return value

Type: `gchar*`

The printed message.

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.