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

[Feat/result call integration]: API 통신 Response를 Result를 활용한 예외처리 로직으로 Refact #279

Draft
wants to merge 5 commits into
base: feat/add_call_adapter
Choose a base branch
from

Conversation

kangyuri1114
Copy link
Member

@kangyuri1114 kangyuri1114 commented Jan 11, 2025

개요

작업 사항

  • BaseResponse에서 data를 추출하는 확장함수 생성

    • Result.fold 사용해 onSuccess, onFailure 처리
    • 실패 시 Throwable을 Result.failure로 반환
    • BaseResponse.data 유효성 확인, 데이터 검증 역할
  • Service 내 함수 반환형 Result로 감싸기

  • data모듈 내 repository 또는 datasource 내 함수 코드 수정

  • mapCatching 활용하여 성공 실패 처리 (성공 시 변환 수행, 실패 시 상태 유지)

참고
https://hivelop.tistory.com/6

변경 사항(optional)

  • 내용을 적어주세요.

스크린샷(optional)

  • 내용을 적어주세요.

@kangyuri1114 kangyuri1114 self-assigned this Jan 11, 2025
@kangyuri1114 kangyuri1114 added 💻feat 새로운 기능 추가 🐰유리 유리 작업 labels Jan 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐰유리 유리 작업 💻feat 새로운 기능 추가
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant