diff options
author | Will Thompson <will.thompson@collabora.co.uk> | 2012-02-03 14:58:42 +0000 |
---|---|---|
committer | Will Thompson <will.thompson@collabora.co.uk> | 2012-03-26 17:15:57 +0100 |
commit | 75d92d599cde42d24d487c12ba3170a300db4311 (patch) | |
tree | 8ffea3ef710a17188d27bba3102ea8ffffe565a0 | |
parent | 04b24840f7ce2956e02384c1b8a200b3f5eaf9ac (diff) | |
download | telepathy-glib-75d92d599cde42d24d487c12ba3170a300db4311.tar.gz |
python/ft example: handle an exception. Hooray!
-rwxr-xr-x | examples/client/python/file-transfer.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/examples/client/python/file-transfer.py b/examples/client/python/file-transfer.py index e47bc4575..cccfae857 100755 --- a/examples/client/python/file-transfer.py +++ b/examples/client/python/file-transfer.py @@ -31,9 +31,13 @@ def state_changed_cb(channel, pspec, data): channel.provide_file_async(file, provide_file_cb, None) def create_channel_cb(request, result, data): - (chan, context) = request.create_and_handle_channel_finish(result) + try: + (chan, context) = request.create_and_handle_channel_finish(result) - chan.connect('notify::state', state_changed_cb, data) + chan.connect('notify::state', state_changed_cb, data) + except GObject.GError, e: + print "Failed to create channel: %s" % e + sys.exit(1) if __name__ == '__main__': #TelepathyGLib.debug_set_flags("all") |