Fix #1927: useful error message for failed edit

This commit is contained in:
Adrian Sampson 2016-04-03 17:42:25 -04:00
parent 3f4f077272
commit fa2aa82a0d
2 changed files with 8 additions and 1 deletions

View file

@ -46,7 +46,12 @@ def edit(filename, log):
cmd = util.shlex_split(util.editor_command())
cmd.append(filename)
log.debug(u'invoking editor command: {!r}', cmd)
subprocess.call(cmd)
try:
subprocess.call(cmd)
except OSError as exc:
raise ui.UserError(u'could not run editor command {!r}: {}'.format(
cmd[0], exc
))
def dump(arg):

View file

@ -24,6 +24,8 @@ Fixes:
LyricsWiki page markup. :bug:`1912` :bug:`1909`
* :doc:`/plugins/lyrics`: Also fix retrieval from Musixmatch and the way we
guess the URL for lyrics. :bug:`1880`
* :doc:`/plugins/error`: Fail gracefully when the configured text editor
command can't be invoked. :bug:`1927`
1.3.17 (February 7, 2016)