6262 VHostName :: vhost :name (),
6363 Limits :: vhost :limits (),
6464 Metadata :: vhost :metadata (),
65- Ret :: {existing | new , VHost },
65+ Ret :: {existing | new , VHost } | no_return () ,
6666 VHost :: vhost :vhost ().
6767% % @doc Writes a virtual host record if it doesn't exist already or returns
6868% % the existing one.
@@ -117,7 +117,9 @@ create_or_get_in_khepri(VHostName, VHost) ->
117117-spec merge_metadata (VHostName , Metadata ) -> Ret when
118118 VHostName :: vhost :name (),
119119 Metadata :: vhost :metadata (),
120- Ret :: {ok , VHost } | {error , {no_such_vhost , VHostName }},
120+ Ret :: {ok , VHost } |
121+ {error , {no_such_vhost , VHostName }} |
122+ rabbit_khepri :timeout_error (),
121123 VHost :: vhost :vhost ().
122124% % @doc Updates the metadata of an existing virtual host record.
123125% %
@@ -188,7 +190,7 @@ merge_metadata_in_khepri(VHostName, Metadata) ->
188190-spec set_tags (VHostName , Tags ) -> VHost when
189191 VHostName :: vhost :name (),
190192 Tags :: [vhost :tag () | binary () | string ()],
191- VHost :: vhost :vhost ().
193+ VHost :: vhost :vhost () | no_return () .
192194% % @doc Sets the tags of an existing virtual host record.
193195% %
194196% % @returns the updated virtual host record if the record existed and the
@@ -347,7 +349,7 @@ list_in_khepri() ->
347349-spec update (VHostName , UpdateFun ) -> VHost when
348350 VHostName :: vhost :name (),
349351 UpdateFun :: fun ((VHost ) -> VHost ),
350- VHost :: vhost :vhost ().
352+ VHost :: vhost :vhost () | no_return () .
351353% % @doc Updates an existing virtual host record using the result of
352354% % `UpdateFun'.
353355% %
@@ -439,9 +441,10 @@ with_fun_in_khepri_tx(VHostName, Thunk) ->
439441% % delete().
440442% % -------------------------------------------------------------------
441443
442- -spec delete (VHostName ) -> Existed when
444+ -spec delete (VHostName ) -> Ret when
443445 VHostName :: vhost :name (),
444- Existed :: boolean ().
446+ Existed :: boolean (),
447+ Ret :: Existed | rabbit_khepri :timeout_error ().
445448% % @doc Deletes a virtual host record from the database.
446449% %
447450% % @returns a boolean indicating if the vhost existed or not. It throws an
@@ -468,7 +471,7 @@ delete_in_khepri(VHostName) ->
468471 case rabbit_khepri :delete_or_fail (Path ) of
469472 ok -> true ;
470473 {error , {node_not_found , _ }} -> false ;
471- _ -> false
474+ { error , _ } = Err -> Err
472475 end .
473476
474477% % -------------------------------------------------------------------
0 commit comments