Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

304 status code being handled as error #1111

Open
2 tasks
babycroc opened this issue Sep 29, 2024 · 0 comments
Open
2 tasks

304 status code being handled as error #1111

babycroc opened this issue Sep 29, 2024 · 0 comments
Labels
bug Something isn't working front-end help wanted Extra attention is needed

Comments

@babycroc
Copy link
Contributor

제안 내용 *

코드를 보면 이런 부분이 많아요

  switch (status) {
    case 200:
    case 304:
      return data;
    default:
      throw new UnexpectedAPIResponseError();
  }

그 이유는... 원래는 success code (200, 201 등등)에 대해서만 return data;를 해줬는데,
가끔가다 멀쩡해야 하는데 Error 라고 나타나더라고요?!
이유를 살펴보니 API 응답이 304로 올 때가 있는데, 명시해준 success status code가 아니니까 에러로 처리되더라구요,,,
지금은 땜빵 용도로 API GET할 때마다 200, 304를 같이 success로 처리해주고 있는데,
이걸 똑똑하게 처리해 볼 수는 없을까여

검색해보니 이런 거랑 비슷한 것 같기도 하고...
axios/axios#703

어쨌든 axios 딴에서 304일 경우 (304 말고 같이 처리되어야 하는 응답 코드가 있을지는 확인해봐야 함!!) 에러로 처리되지 않게끔 무언가 잘 작업이 필요함

스크린샷

관련 Task *

  • Task1
  • Task2
@babycroc babycroc added bug Something isn't working help wanted Extra attention is needed front-end labels Sep 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working front-end help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant