Skip to content

Commit

Permalink
better errors
Browse files Browse the repository at this point in the history
  • Loading branch information
beyang committed Sep 23, 2024
1 parent 594bc80 commit 67ddd79
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions agent/src/cli/command-bench/strategy-chat-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ async function runContextCommand(examples: Example[], outputFile: string): Promi
const repoNames = targetRepoRevs.map(repoRev => repoRev.repoName)
const repoIDNames = await graphqlClient.getRepoIds(repoNames, repoNames.length + 10)
if (isError(repoIDNames)) {
throw repoIDNames
throw new Error(`getRepoIds failed for [${repoNames.join(',')}]: ${repoIDNames}`)
}
if (repoIDNames.length !== repoNames.length) {
throw new Error(
Expand All @@ -69,10 +69,10 @@ async function runContextCommand(examples: Example[], outputFile: string): Promi
filePatterns: [],
})
if (isError(resultsResp)) {
throw resultsResp
throw new Error(`contextSearch failed for [${repoNames.join(',')}]: ${resultsResp}`)
}
if (resultsResp === null) {
throw new Error('!!! null results')
throw new Error(`contextSearch failed for [${repoNames.join(',')}]: null results`)
}
const results = resultsResp ?? []
const actualContext: EvalContextItem[] = results.map(result => ({
Expand Down

0 comments on commit 67ddd79

Please sign in to comment.