Skip to content

Commit dc38334

Browse files
committed
suppress unhandled exception, addressing #215
1 parent 19a0ae2 commit dc38334

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

sydney/stream.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,11 @@ func (o *Sydney) AskStreamRaw(options AskStreamOptions) (CreateConversationRespo
469469
}
470470
result := gjson.Parse(msg)
471471
if result.Get("type").Int() == 2 && result.Get("item.result.value").String() != "Success" {
472+
if result.Get("item.result.message").String() == "Unhandled Exception" {
473+
slog.Warn("Suppressed Unhandled Exception", "v",
474+
result.Get("item.result").Raw)
475+
return
476+
}
472477
msgChan <- RawMessage{
473478
Error: errors.New("bing explicit error: value: " +
474479
result.Get("item.result.value").String() + "; message: " +

0 commit comments

Comments
 (0)