Centralized error handling retrofit 2?

前端 未结 4 1606
小蘑菇
小蘑菇 2020-12-31 03:14

Before retrofit 2, there was a way of handling erros centrally -

new retrofit.RestAdapter.Builder()
        .setEndpoint(apiUrl)
        .setLogLevel(retro         


        
4条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-31 03:56

    For handing cases specific to 401 centrally and also for retrying requests with new auth token, please refer to this stack overflow answer.

提交回复
热议问题