Skip to content

Commit

Permalink
Add error if too many spans found
Browse files Browse the repository at this point in the history
  • Loading branch information
Mythicaeda committed Mar 18, 2024
1 parent 0895a6a commit 423034f
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,13 @@ export const simulatedActivityInstanceBySimulatedActivityIdBatchLoader: BatchLoa
);
}

if(spans.length > 1) {
return new ErrorWithStatusCode(
`Too many spans with simulated activity id ${simulatedActivityId} found for simulation_dataset with id ${simulationDatasetId}`,
404,
);
}

const span = spans[0];
const simulatedActivity: GraphQLSimulatedActivityInstance = {
id: span.id,
Expand Down

0 comments on commit 423034f

Please sign in to comment.