diff --git a/src/main/java/org/caosdb/server/query/Query.java b/src/main/java/org/caosdb/server/query/Query.java
index 07a165a352ba9a07a345018e7d287cd961f4a00b..864c73c0ff641d5c8e5bdc50b34ddd4c0edcc31b 100644
--- a/src/main/java/org/caosdb/server/query/Query.java
+++ b/src/main/java/org/caosdb/server/query/Query.java
@@ -1053,4 +1053,8 @@ public class Query implements QueryInterface, ToElementable, TransactionInterfac
   public UTCDateTime getTimestamp() {
     return null;
   }
+
+  public List<ToElementable> getMessages() {
+    return messages;
+  }
 }
diff --git a/src/test/java/org/caosdb/server/query/TestCQL.java b/src/test/java/org/caosdb/server/query/TestCQL.java
index 3217d4228068027628b1846eb6073da1bc18052e..31c72f7b87dc3006158ea97777e14bb0136899af 100644
--- a/src/test/java/org/caosdb/server/query/TestCQL.java
+++ b/src/test/java/org/caosdb/server/query/TestCQL.java
@@ -278,6 +278,11 @@ public class TestCQL {
       "SELECT 'name with spaces.and dot', 'name with spaces'.name, name with spaces.name, name with\\,comma and\\.dot and \\'single_quote.sub FROM ENTITY";
   String issue130b = "SELECT 'Wrapper' FROM RECORD TestRT";
 
+  // https://gitlab.com/caosdb/caosdb-server/-/issues/160
+  String issue160a = "FIND ename WITH pname => val";
+  String issue160b = "FIND ename WITH pname =< val";
+  String issue160c = "FIND ename WITH pname =! val";
+
   @Test
   public void testQuery1()
       throws InterruptedException, SQLException, ConnectionException, QueryException {
@@ -6989,4 +6994,46 @@ public class TestCQL {
     assertEquals("Wrapper", sfq.s.get(0).getSelector());
     assertNull(sfq.s.get(0).getSubselection());
   }
+
+  // TODO fix https://gitlab.com/caosdb/caosdb-server/-/issues/160
+  @Test(expected = IndexOutOfBoundsException.class)
+  public void testIssue40a() {
+
+    Query q = new Query(this.issue160a);
+
+    try {
+      q.parse();
+    } catch (Query.ParsingException e) {
+      // ignore for now
+    }
+    assertEquals(q.getMessages().get(0), "Appropriate Error");
+  }
+
+  // TODO fix https://gitlab.com/caosdb/caosdb-server/-/issues/160
+  @Test(expected = IndexOutOfBoundsException.class)
+  public void testIssue40b() {
+
+    Query q = new Query(this.issue160b);
+
+    try {
+      q.parse();
+    } catch (Query.ParsingException e) {
+      // ignore for now
+    }
+    assertEquals(q.getMessages().get(0), "Appropriate Error");
+  }
+
+  // TODO fix https://gitlab.com/caosdb/caosdb-server/-/issues/160
+  @Test(expected = IndexOutOfBoundsException.class)
+  public void testIssue40c() {
+
+    Query q = new Query(this.issue160c);
+
+    try {
+      q.parse();
+    } catch (Query.ParsingException e) {
+      // ignore for now
+    }
+    assertEquals(q.getMessages().get(0), "Appropriate Error");
+  }
 }