From 209383a11bbf749dcc830fac8e0938bca0b58191 Mon Sep 17 00:00:00 2001 From: Marcos Magueta Date: Tue, 21 Jul 2026 01:35:52 -0300 Subject: Lifecycle Manager --- lib/backend/managers/Handle.ml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'lib/backend/managers/Handle.ml') diff --git a/lib/backend/managers/Handle.ml b/lib/backend/managers/Handle.ml index ed2f220..872af43 100644 --- a/lib/backend/managers/Handle.ml +++ b/lib/backend/managers/Handle.ml @@ -18,6 +18,10 @@ let not_a_relation () : Concepts.Condition.condition = Concepts.Condition.condition "not-a-relation" "handle does not refer to a stored or ephemeral relation" Concepts.Condition.empty +let no_such_object () : Concepts.Condition.condition = + Concepts.Condition.condition "no-such-object" "no object registered at the given path" + Concepts.Condition.empty + module Make (Store : Abstract.Storage.STORAGE) = struct module Cur = Cursor.Make (Store) @@ -28,8 +32,9 @@ module Make (Store : Abstract.Storage.STORAGE) = struct let create objects txn = {objects; txn} let open_ t ~path = - let object_ = Object.find path t.objects in - Ok {object_; txn= t.txn} + match Object.find path t.objects with + | Some object_ -> Ok {object_; txn= t.txn} + | None -> Error (no_such_object ()) let relation_descriptor (object_ : Object.registry) : (Cursor.descriptor, Concepts.Condition.condition) result = -- cgit v1.2.3