From 461dd8c15719f1804e0f53c038a968fc32cae4ed Mon Sep 17 00:00:00 2001 From: Pavel 'LEdoian' Turinsky Date: Mon, 4 May 2020 23:27:22 +0200 Subject: [PATCH] Fail safe when user chooses a bad option --- markdownrunner.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/markdownrunner.py b/markdownrunner.py index 6607c6c..e14948a 100755 --- a/markdownrunner.py +++ b/markdownrunner.py @@ -158,6 +158,11 @@ def user_action(hunk: Sequence[Command], context=None) -> Sequence[Command]: return hunk elif answer.startswith(('n', 'N')): return [] + else: + # Bad choice or error. Notify user and try again + print("Bad choice, or maybe bug.") + # No goto, use recursion + return user_action(hunk, context)