void
gaim_connection_error(GaimConnection *gc, const char *text)
{
	GaimConnectionUiOps *ops;

	g_return_if_fail(gc   != NULL);
	g_return_if_fail(text != NULL);

	/* If we've already got one error, we don't need any more */
	if (gc->disconnect_timeout)
		return;

	ops = gaim_get_connection_ui_ops();

	if (ops != NULL) {
		if (ops->report_disconnect != NULL)
			ops->report_disconnect(gc, text);

		if (ops->disconnected != NULL)
			ops->disconnected(gc);
	}

	gc->disconnect_timeout = g_timeout_add(0, gaim_connection_disconnect_cb,
			gaim_connection_get_account(gc));
}