Better handling for urlview errors. #262.

This commit is contained in:
Michael Lazar
2016-07-26 23:05:35 -07:00
parent 357ee4feed
commit a1b7b7310f

View File

@@ -455,6 +455,16 @@ class Terminal(object):
p.communicate(input=data.encode('utf-8'))
except KeyboardInterrupt:
p.terminate()
code = p.poll()
if code == 1:
# Clear the "No URLs found." message from stdout
sys.stdout.write("\033[F")
sys.stdout.flush()
if code == 1:
self.show_notification('No URLs found')
except OSError:
self.show_notification(
'Failed to open {0}'.format(urlview))