I am using retrofit 2.3.0 for network in Android app. I get response of say Person object I deserialize it using GsonConverter. But sometime server sends normal String rather than json object then I get JsonSyntaxException because deserialzer expects json object rather than String. String comes only when server times out so rather than getting exception I want to show "time out".
How to handle these situations when server returns plain string rather than Object with Retrofit?