From e70169257eab3581fb9c826cb9a00449850a4eb7 Mon Sep 17 00:00:00 2001 From: Lincoln Stein Date: Mon, 22 Aug 2022 16:55:06 -0400 Subject: [PATCH] better exception handling for out of memory errors and badly formatted prompts --- scripts/dream.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/scripts/dream.py b/scripts/dream.py index 8e4c6b2645..aa038b887c 100755 --- a/scripts/dream.py +++ b/scripts/dream.py @@ -90,7 +90,12 @@ def main_loop(t2i,parser,log): done = True break - elements = shlex.split(command) + try: + elements = shlex.split(command) + except ValueError as e: + print(str(e)) + continue + if len(elements)==0: continue @@ -133,6 +138,10 @@ def main_loop(t2i,parser,log): except KeyboardInterrupt: print('*interrupted*') continue + except RuntimeError as e: + print(str(e)) + continue + print("goodbye!")