I'm trying to convert this Java code to Kotlin:
public class HeaderInterceptor implements Interceptor {
@Override public Response intercept(Chain chain) throws IOException {
return null;
}
}
The problem is, when I implement the methods, I get something like
class JsonHeadersInterceptor : Interceptor {
override fun intercept(chain: Interceptor.Chain?): Response? {
throw UnsupportedOperationException()
}
}
The only info I've found talking about throwing exceptions in Kotlin is THIS.
Apart from removing the question mark, because it's not necessary, why it doesn't handle the IOException
the same way? What is the best approach to handle this situation?