From 418104165478879e9f58b890972f88c88de24b46 Mon Sep 17 00:00:00 2001
From: h7x4 <h7x4@nani.wtf>
Date: Sat, 17 May 2025 19:01:05 +0200
Subject: [PATCH] repl/InteractiveItemSelector: wrap `execute_selection` in
 try-catch

---
 src/libdib/repl.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/libdib/repl.py b/src/libdib/repl.py
index ed904fd..79e9443 100644
--- a/src/libdib/repl.py
+++ b/src/libdib/repl.py
@@ -73,7 +73,10 @@ class InteractiveItemSelector(Cmd):
 
 
     def default(self, arg: str):
-        result = self.execute_selection(self.sql_session, self.cls, arg)
+        try:
+          result = self.execute_selection(self.sql_session, self.cls, arg)
+        except Exception as e:
+          print(f'Error executing selection: {e}')
 
         if len(result) != 1:
             print(f'No such {self.cls.__name__} found: {arg}')