Frage

I have a class which extends SpiceRequest, but I need to call the onRequestFailure(SpiceException) method when a failure has occured in the loadDataFromNetwork() method. I tried to throw an exception inside that method but that doesn't fire the onRequestFailure(SpiceException) method.

How could I make this work?

War es hilfreich?

Lösung

For sure something is wrong in your code, if you really throw an exception, it will be wrapped inside a SpiceException. Invoke spiceException.getCause() to get your original exception.

Check the logs, you should see that exception being processed inside RoboSpice. Maybe something wrong happens before with the cache, but normally the exception will be passed to the listener.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top