Gio.Task.report_error

function report_error(source_object: GObject.Object, callback: Gio.AsyncReadyCallback, source_tag: void, error: GLib.Error): void {
    // Gjs wrapper for g_task_report_error()
}
  

Creates a Gio.Task and then immediately calls Gio.Task.prototype.return_error on it. Use this in the wrapper function of an asynchronous method when you want to avoid even calling the virtual method. You can then use Gio.AsyncResult.prototype.is_tagged in the finish method wrapper to check if the result there is tagged as having been created by the wrapper method, and deal with it appropriately if so.

See also Gio.Task.report_new_error.

Since 2.36

source_object

the GObject.Object that owns this task, or null.

callback

a Gio.AsyncReadyCallback.

source_tag

an opaque pointer indicating the source of this task

error

error to report