Skip to content

Commit

Permalink
chore(internal): add debug logs for stream responses (#182)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-bot committed Oct 16, 2023
1 parent c819ea4 commit 004423e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ type APIResponseProps = {
async function defaultParseResponse<T>(props: APIResponseProps): Promise<T> {
const { response } = props;
if (props.options.stream) {
debug('response', response.status, response.url, response.headers, response.body);

// Note: there is an invariant here that isn't represented in the type system
// that if you set `stream: true` the response type must also be `Stream<T>`
return Stream.fromSSEResponse(response, props.controller) as any;
Expand Down

0 comments on commit 004423e

Please sign in to comment.