viewers: Log spice message on error state

This commit is contained in:
Cole Robinson 2016-05-16 15:47:37 -04:00
parent 6a3b2a68c3
commit 8719acbbd3
1 changed files with 9 additions and 5 deletions

View File

@ -556,11 +556,15 @@ class SpiceViewer(Viewer):
logging.debug("Spice channel received ERROR_AUTH, but a "
"password is already set. Assuming authentication failed.")
self.emit("auth-error", channel.get_error().message, False)
elif event in [SpiceClientGLib.ChannelEvent.ERROR_CONNECT,
SpiceClientGLib.ChannelEvent.ERROR_IO,
SpiceClientGLib.ChannelEvent.ERROR_LINK,
SpiceClientGLib.ChannelEvent.ERROR_TLS]:
logging.debug("Spice channel event error: %s", event)
elif "ERROR" in str(event):
# SpiceClientGLib.ChannelEvent.ERROR_CONNECT
# SpiceClientGLib.ChannelEvent.ERROR_IO
# SpiceClientGLib.ChannelEvent.ERROR_LINK
# SpiceClientGLib.ChannelEvent.ERROR_TLS
error = None
if channel.get_error():
error = channel.get_error().message
logging.debug("Spice channel event=%s message=%s", event, error)
self.emit("disconnected")
def _fd_channel_event_cb(self, channel, event):