MJ Studio
1 min readJan 29, 2020

--

6번 과정에서 기존 response의 .newBuilder() 를 이용해 기존 응답에 Body와 도움이 될만한 Message를 추가만 하기 때문에 Retrofit통신의 소비자에서 받을 수 있는 예외는 변하지 않습니다.
Interceptor 레벨에서 가능한 코드는 당장 떠오르지 않는데, Interceptor는 네트워트 통신 과정의 중간에 있는 pipeline 이기 때문에 최종 소비자 단계에서 처리를 하는것이 맞다고 보여집니다.
네트워크 로그는 특별한 방법은 안쓰고 HttpLoggingInterceptor 를 이용해서 개발시에 찍어보고있습니다.

private val client = OkHttpClient.Builder()
.addInterceptor(loggingInterceptor)
.addNetworkInterceptor(commonNetworkInterceptor)
.build()

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

MJ Studio
MJ Studio

Written by MJ Studio

a Developer, Student, Learner.

No responses yet

Write a response