Skip to content

Commit 8650809

Browse files
committed
Less diff
1 parent 854aa50 commit 8650809

File tree

1 file changed

+7
-3
lines changed
  • lib/executor/src/executors

1 file changed

+7
-3
lines changed

lib/executor/src/executors/map.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,12 @@ impl SubgraphExecutorMap {
154154
client_request,
155155
)
156156
})
157-
.unwrap_or_else(|| self.get_executor_from_static_endpoint(subgraph_name))
157+
.unwrap_or_else(|| {
158+
self.get_executor_from_static_endpoint(subgraph_name)
159+
.ok_or_else(|| {
160+
SubgraphExecutorError::StaticEndpointNotFound(subgraph_name.to_string())
161+
})
162+
})
158163
}
159164

160165
/// Looks up a subgraph executor,
@@ -207,7 +212,7 @@ impl SubgraphExecutorMap {
207212
fn get_executor_from_static_endpoint(
208213
&self,
209214
subgraph_name: &str,
210-
) -> Result<SubgraphExecutorBoxedArc, SubgraphExecutorError> {
215+
) -> Option<SubgraphExecutorBoxedArc> {
211216
self.static_endpoints_by_subgraph
212217
.get(subgraph_name)
213218
.and_then(|endpoint_ref| {
@@ -216,7 +221,6 @@ impl SubgraphExecutorMap {
216221
.get(subgraph_name)
217222
.and_then(|endpoints| endpoints.get(endpoint_str).map(|e| e.clone()))
218223
})
219-
.ok_or_else(|| SubgraphExecutorError::StaticEndpointNotFound(subgraph_name.to_string()))
220224
}
221225

222226
/// Registers a VRL expression for the given subgraph name.

0 commit comments

Comments
 (0)