From f38741229e29f534f27fd575bcef9a541565efac Mon Sep 17 00:00:00 2001 From: mikebender Date: Thu, 18 Jan 2024 10:19:01 -0500 Subject: [PATCH] fix: Reject instead of returning a null table - Returning a `null` instead of an actual table is weird. Throw to indicate the key could not be found. --- .../java/io/deephaven/web/client/api/JsPartitionedTable.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/client-api/src/main/java/io/deephaven/web/client/api/JsPartitionedTable.java b/web/client-api/src/main/java/io/deephaven/web/client/api/JsPartitionedTable.java index 5eca478264d..3cfa64e0741 100644 --- a/web/client-api/src/main/java/io/deephaven/web/client/api/JsPartitionedTable.java +++ b/web/client-api/src/main/java/io/deephaven/web/client/api/JsPartitionedTable.java @@ -169,8 +169,8 @@ public Promise getTable(Object key) { } final List keyList = Js.>uncheckedCast(key).asList(); if (!knownKeys.contains(keyList)) { - // key doesn't even exist, just hand back a null table - return Promise.resolve((JsTable) null); + // key doesn't even exist + return Promise.reject("Key not found"); } final String[] columnNames = descriptor.getKeyColumnNamesList().asArray(new String[0]); final String[] columnTypes = keyColumnTypes.toArray(new String[0]);