Skip to content

Commit

Permalink
fetch 오류 발생 시 sentry에 보고 및 기본 값 리턴
Browse files Browse the repository at this point in the history
  • Loading branch information
guswl98 committed Aug 5, 2024
1 parent ece61be commit 471b230
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/react-contexts/src/images-context/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
import qs from 'qs'
import { ImageMeta } from '@titicaca/type-definitions'
import { DeepPartial } from 'utility-types'
import { get } from '@titicaca/fetcher'
import { captureHttpError, get } from '@titicaca/fetcher'

import reducer, {
loadImagesRequest,
Expand Down Expand Up @@ -280,7 +280,8 @@ async function fetchPoiImages(
const { parsedBody } = response
return parsedBody
} else {
throw new Error(`Failed to fetch poi images ${response.parsedBody.message}`)
captureHttpError(response)
return { data: [], total: 0 }
}
}

Expand All @@ -304,9 +305,8 @@ async function fetchPoiReviewImages(
const { parsedBody } = response
return parsedBody
} else {
throw new Error(
`Failed to fetch poi review images: ${response.parsedBody.message}`,
)
captureHttpError(response)
return { data: [], total: 0 }
}
}

Expand Down

0 comments on commit 471b230

Please sign in to comment.