aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver/frontend/html/pages/entry.js
diff options
context:
space:
mode:
authorzousar <[email protected]>2026-02-18 23:15:09 -0700
committerzousar <[email protected]>2026-02-18 23:15:09 -0700
commita948ff9570a5a9d8ec424639cba6f973247a0372 (patch)
tree341a975228d1c2f65e53922e33b1255ca5bbdfab /src/zenserver/frontend/html/pages/entry.js
parentupdatefrontend (diff)
downloadzen-a948ff9570a5a9d8ec424639cba6f973247a0372.tar.xz
zen-a948ff9570a5a9d8ec424639cba6f973247a0372.zip
entry.js handles missing/native items more gracefully
Diffstat (limited to 'src/zenserver/frontend/html/pages/entry.js')
-rw-r--r--src/zenserver/frontend/html/pages/entry.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/zenserver/frontend/html/pages/entry.js b/src/zenserver/frontend/html/pages/entry.js
index c4746bf52..f418b17ba 100644
--- a/src/zenserver/frontend/html/pages/entry.js
+++ b/src/zenserver/frontend/html/pages/entry.js
@@ -181,6 +181,22 @@ export class Page extends ZenPage
async _build_page()
{
var entry = await this._entry;
+
+ // Check if entry exists
+ if (!entry || entry.as_object().find("entry") == null)
+ {
+ const opkey = this.get_param("opkey");
+ var section = this.add_section("Entry Not Found");
+ section.tag("p").text(`The entry "${opkey}" is not present in this dataset.`);
+ section.tag("p").text("This could mean:");
+ const list = section.tag("ul");
+ list.tag("li").text("The entry is for an instance defined in code");
+ list.tag("li").text("The entry has not been added to the oplog yet");
+ list.tag("li").text("The entry key is misspelled");
+ list.tag("li").text("The entry was removed or never existed");
+ return;
+ }
+
entry = entry.as_object().find("entry").as_object();
const name = entry.find("key").as_value();