From d2ed157383faaed8e297c484728595c180fa0f0e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Henrik=20tom=20W=C3=B6rden?= <h.tomwoerden@indiscale.com>
Date: Thu, 29 Jun 2023 16:20:54 +0200
Subject: [PATCH] FIX: raise error if key is not found

---
 src/caosdb/common/models.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/caosdb/common/models.py b/src/caosdb/common/models.py
index 1165ced5..4acbcd1a 100644
--- a/src/caosdb/common/models.py
+++ b/src/caosdb/common/models.py
@@ -2548,7 +2548,7 @@ class Messages(list):
             code = None
         m = self.get(type, code)
         if m is None:
-            return
+            raise KeyError()
         if m.description:
             return (m.description, m.body)
         else:
-- 
GitLab