2017-03-31 3 views

Répondre

1

fromCallable prend un Callable qui a un call() throws Exception méthode, par conséquent, vous pouvez déclarer votre méthode comme throws X où X est le type d'exception que vous devez jeter:

public String beginUpload(String filePath) throws IOException { 
    throw new IOException(); 
} 
+0

il sera alors pris dans Observable.subscribe (@Override public final onError void (e Throwable))? – Mike6679

+0

'fromCallable' l'attrape et appelle' onError() 'sur le' Subscriber'. – akarnokd