diff options
author | Pavel Grunt <pgrunt@redhat.com> | 2015-03-20 10:35:56 +0100 |
---|---|---|
committer | Fabiano FidĂȘncio <fidencio@redhat.com> | 2015-03-23 19:32:02 +0100 |
commit | 1a619f23835abcc358b84bcead14171361907038 (patch) | |
tree | 0ea1656197ea266863951dbddc736a254b0ac655 /src/remote-viewer-main.c | |
parent | 526e882368eb74eb1ed9de5c1c8aefb7b428fb9d (diff) | |
download | virt-viewer-1a619f23835abcc358b84bcead14171361907038.tar.gz virt-viewer-1a619f23835abcc358b84bcead14171361907038.tar.xz virt-viewer-1a619f23835abcc358b84bcead14171361907038.zip |
Report errors in one place
Since the error is propagated to the main, report the error there.
To make it work GError VIRT_VIEWER_ERROR_FAILED is set for all
failing states and it is reported using virt_viewer_app_simple_message_dialog().
Diffstat (limited to 'src/remote-viewer-main.c')
-rw-r--r-- | src/remote-viewer-main.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/remote-viewer-main.c b/src/remote-viewer-main.c index 1bb61c7..749fac1 100644 --- a/src/remote-viewer-main.c +++ b/src/remote-viewer-main.c @@ -176,6 +176,9 @@ main(int argc, char **argv) if (!virt_viewer_app_start(app, &error)) { if (g_error_matches(error, VIRT_VIEWER_ERROR, VIRT_VIEWER_ERROR_CANCELLED)) ret = 0; + else if (error) { + virt_viewer_app_simple_message_dialog(app, error->message); + } goto cleanup; } |