Open
Description
Hi,
I'm wondering why this potienital json decode be ignored:
openai/lib/src/core/networking/client.dart
Lines 390 to 392 in 650ffbf
I'm using a Microsoft Azure provided openai services behand a cloudflare worker. when I misspelled the model name, I got a 403 response which body is not a valid json. In this case,I am unable to get either the data or the error message.
Is it possible to change here to this:
try {
decodedData = decodeToMap(respondData);
} catch (error) {
final statusCode = respond.statusCode;
final exception = RequestFailedException(error.toString(), statusCode);
yield* Stream<T>.error(exception);
}
Metadata
Metadata
Assignees
Labels
No labels