diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2013-01-12 00:25:16 +0100 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2013-01-12 01:01:37 +0100 |
commit | 0fb90dea38d521ab696966718140853c74be9f72 (patch) | |
tree | 899ade32a6818d928999e7889c307ab3d805831d /gtk | |
parent | 4835d06f95c977ec8af5b862b19e057968358986 (diff) |
file-xfer: non-programming errors should be reported in async
It is fine to not return async errors for programming errors via
g_return_if_fail() and friends, however, we need to return proper
error if it's a normal run-time error.
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/channel-main.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/gtk/channel-main.c b/gtk/channel-main.c index ef699ae..c8a1013 100644 --- a/gtk/channel-main.c +++ b/gtk/channel-main.c @@ -2723,12 +2723,20 @@ void spice_main_file_copy_async(SpiceMainChannel *channel, g_return_if_fail(SPICE_IS_MAIN_CHANNEL(channel)); g_return_if_fail(sources != NULL && sources[0] != NULL); - g_return_if_fail(c->agent_connected); - /* At the moment, the copy() method is limited to a single file, support for copying multi-files will be implemented later. */ g_return_if_fail(sources[1] == NULL); + if (!c->agent_connected) { + g_simple_async_report_error_in_idle(G_OBJECT(channel), + callback, + user_data, + SPICE_CLIENT_ERROR, + SPICE_CLIENT_ERROR_FAILED, + "The agent is not connected"); + return; + } + file_xfer_send_start_msg_async(channel, sources[0], flags, |