@@ -28,6 +28,7 @@ use zenoh_config::unwrap_or_default;
28
28
use zenoh_config:: Config ;
29
29
use zenoh_protocol:: core:: { ExprId , WhatAmI , ZenohId } ;
30
30
use zenoh_protocol:: network:: Mapping ;
31
+ use zenoh_result:: ZResult ;
31
32
// use zenoh_collections::Timer;
32
33
use zenoh_sync:: get_mut_unchecked;
33
34
@@ -76,15 +77,20 @@ pub struct Tables {
76
77
}
77
78
78
79
impl Tables {
79
- pub fn new ( zid : ZenohId , whatami : WhatAmI , hlc : Option < Arc < HLC > > , config : & Config ) -> Self {
80
+ pub fn new (
81
+ zid : ZenohId ,
82
+ whatami : WhatAmI ,
83
+ hlc : Option < Arc < HLC > > ,
84
+ config : & Config ,
85
+ ) -> ZResult < Self > {
80
86
let drop_future_timestamp =
81
87
unwrap_or_default ! ( config. timestamping( ) . drop_future_timestamp( ) ) ;
82
88
let router_peers_failover_brokering =
83
89
unwrap_or_default ! ( config. routing( ) . router( ) . peers_failover_brokering( ) ) ;
84
90
// let queries_default_timeout =
85
91
// Duration::from_millis(unwrap_or_default!(config.queries_default_timeout()));
86
92
let hat_code = hat:: new_hat ( whatami, config) ;
87
- Tables {
93
+ Ok ( Tables {
88
94
zid,
89
95
whatami,
90
96
face_counter : 0 ,
@@ -96,11 +102,11 @@ impl Tables {
96
102
faces : HashMap :: new ( ) ,
97
103
mcast_groups : vec ! [ ] ,
98
104
mcast_faces : vec ! [ ] ,
99
- interceptors : interceptor_factories ( config) ,
105
+ interceptors : interceptor_factories ( config) ? ,
100
106
pull_caches_lock : Mutex :: new ( ( ) ) ,
101
107
hat : hat_code. new_tables ( router_peers_failover_brokering) ,
102
108
hat_code : hat_code. into ( ) ,
103
- }
109
+ } )
104
110
}
105
111
106
112
#[ doc( hidden) ]
0 commit comments