Skip to content

Commit

Permalink
feat: log (#331)
Browse files Browse the repository at this point in the history
  • Loading branch information
cool-firer authored Oct 9, 2024
1 parent e4d6020 commit ea62442
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion packages/network-support/src/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export function createFetch(
const after = Date.now();
httpVersion = Number(_res.headers.get('httpVersion')) || 1;

let res: object;
let res: object | undefined;
if (type === OrderType.flexPlan) {
[res] = orderManager.extractChannelState(
await _res.text(),
Expand Down Expand Up @@ -153,6 +153,15 @@ export function createFetch(
Number(_res.headers.get('Content-Length')) || 1
);

if (_res.status !== 200 && type === OrderType.fallback) {
logger?.info({
type: 'fallbackDetail',
body: JSON.stringify(body),
res: JSON.stringify(res),
rid,
});
}

return {
status: _res.status,
headers: _res.headers,
Expand Down

0 comments on commit ea62442

Please sign in to comment.