Move fzf error handling into its own class and add appropriate tests

This commit is contained in:
Eric Torres
2021-12-29 23:31:08 -08:00
parent 037f6dd119
commit bdc3ecae3b
4 changed files with 45 additions and 5 deletions

View File

@ -97,8 +97,9 @@ if __name__ == "__main__":
selected_file = fzf.select_file_with_fzf(files)
except KeyboardInterrupt:
exit(error.E_INTERRUPT)
except fzf.FZFError:
exit(error.E_NOFILESELECTED)
except fzf.FZFError as e:
print(e)
exit(e.exit_code)
if selected_file != "":
cmd = editor.gen_editor_cmd(selected_editor, selected_file)