Skip to content

Commit 7c0cb84

Browse files
committed
fix(client): improve error message in parsing JSON
1 parent 6b35dd9 commit 7c0cb84

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lib/BetaMessageStream.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ export class BetaMessageStream implements AsyncIterable<BetaMessageStreamEvent>
597597
snapshotContent.input = partialParse(jsonBuf);
598598
} catch (err) {
599599
const error = new AnthropicError(
600-
`Invalid JSON received in input_json_delta event.\nerror: ${err}\njson: ${jsonBuf}`,
600+
`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${err}. JSON: ${jsonBuf}`,
601601
);
602602
this.#handleError(error);
603603
}

0 commit comments

Comments
 (0)