Skip to content

Commit

Permalink
chore: make message more explicit to see error (#6053)
Browse files Browse the repository at this point in the history
Signed-off-by: Joan Fontanals Martinez <[email protected]>
  • Loading branch information
JoanFM authored Sep 21, 2023
1 parent 3652cfd commit 7d7918d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions jina/serve/runtimes/gateway/graph/topology_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def _validate_against_outgoing_nodes(self):
if node._pydantic_models_by_endpoint is not None: # gateway end

for endp in self._pydantic_models_by_endpoint.keys():
outgoing_enp = endp
outgoing_endp = endp
incoming_endp = (
endp
if endp in node._pydantic_models_by_endpoint
Expand All @@ -91,22 +91,22 @@ def _validate_against_outgoing_nodes(self):

if endp in node._pydantic_models_by_endpoint:
if (
self._pydantic_models_by_endpoint[outgoing_enp][
self._pydantic_models_by_endpoint[outgoing_endp][
'output'
].schema()
!= node._pydantic_models_by_endpoint[incoming_endp][
'input'
].schema()
):
raise Exception(
f'The output schema of {self.name} is incompatible with the input schema of {node.name}'
f'The output schema of {self.name} at {outgoing_endp} endpoint is incompatible with the input schema of {node.name} at {incoming_endp} endpoint'
)
else:
if (
outgoing_enp != __default_endpoint__
outgoing_endp != __default_endpoint__
): # It could happen that there is an Encoder with default followed by an indexer with [index, search]
raise Exception(
f'{node.name} does not expose {incoming_endp} which makes it impossible to be chained with {self.name} on {outgoing_enp}'
f'{node.name} does not expose {incoming_endp} which makes it impossible to be chained with {self.name} on {outgoing_endp}'
)
else:
self.logger.warning(
Expand Down

0 comments on commit 7d7918d

Please sign in to comment.