Skip to content

Commit

Permalink
black list bff
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyenhoaidanh committed Jul 17, 2023
1 parent 0ee992e commit 9b802e2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/utils/iamError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ const sendError = (name: string, apiUrl: string, trackData: any) => {
captureException(error, { level: 'fatal', extra: { args: JSON.stringify(trackData, null, 2) } })
}

// hot fix to prevent spam for now.
const blacklistPathBff = ['/v1/notification/me']

/**
* check error status: blocked, maybe cors issues or server down
* only check bff api + 2 route apis
Expand Down Expand Up @@ -55,7 +58,7 @@ export const checkIamDown = (axiosErr: AxiosError) => {
const isRouteApiDie =
isDie && (apiUrl.endsWith(AGGREGATOR_API_PATHS.GET_ROUTE) || apiUrl.endsWith(AGGREGATOR_API_PATHS.BUILD_ROUTE))

const isIamDie = isDie && apiUrl.startsWith(BFF_API)
const isIamDie = isDie && apiUrl.startsWith(BFF_API) && !blacklistPathBff.some(path => apiUrl.endsWith(path))

if (isRouteApiDie) {
ErrorInfo.routeApiError++
Expand Down

0 comments on commit 9b802e2

Please sign in to comment.