어떻게 개발 할지 설명
- Interceptor 를 생성해서 ErrorResponse를 catch 해서 정의된 예외를 throw를 던진다.
- runCatching 을 사용해서, onFailure 일때, Interceptor에서 생성한 예외를 던진다.
- viewModel에서 .catch 에서 예외 타입과 상황에 맞게 event를 발생시킨다.
- 발생된 event에 따라 유저의 화면이 바뀐다.
고려해야 할 사항, 이야기 나누어야 할 상황
- 정의할 Exception은 어느 layer에 있어야 하는가?
- data layer에 일단 두었는데, viewModel 은 모르지 않나?
*CoroutineExceptionHandler*
을 사용할것 인가?