GLib.clear_error

function clear_error(): void {
    // Gjs wrapper for g_clear_error()
}
  

If @err is null, does nothing. If @err is non-null, calls GLib.Error.prototype.free on *@err and sets *@err to null.