Permalink
Browse files

Handle CommandError in show_source_cb

  • Loading branch information...
The-Compiler committed Aug 18, 2016
1 parent 788eebc commit ccc676c04fbbf78c0911fa6fd4ed4313b0d3c835
Showing with 5 additions and 1 deletion.
  1. +5 −1 qutebrowser/browser/commands.py
@@ -1356,7 +1356,11 @@ def show_source_cb(source):
formatter = pygments.formatters.HtmlFormatter(full=True,
linenos='table')
highlighted = pygments.highlight(source, lexer, formatter)
current_url = self._current_url()
try:
current_url = self._current_url()
except cmdexc.CommandError as e:
message.error(self._win_id, str(e))
return
new_tab = self._tabbed_browser.tabopen(explicit=True)
new_tab.set_html(highlighted, current_url)
new_tab.data.viewing_source = True

0 comments on commit ccc676c

Please sign in to comment.