Retrofit 2 synchronous call error handling for 4xx Errors
问题 I'm using a android-priority-jobqueue and I use retrofit to make synchronous calls to my rest api but i'm unsure how to handle errors like 401 Unauthorized errors which I send back json stating the error. Simple when doing async calls but I'm adapting my app for job manager. below is a simple try catch for IO exceptions, but 401's 422's etc? How to do this? try { PostService postService = ServiceGenerator.createService(PostService.class); final Call<Post> call = postService.addPost(post);